Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 18 additions & 146 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@
"endColumn": 50,
"lineCount": 1
}
},
{
"code": "reportCallIssue",
"range": {
"startColumn": 13,
"endColumn": 78,
"lineCount": 1
}
}
],
"./examples/expansion-toys.py": [
Expand Down Expand Up @@ -5447,14 +5439,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 42,
"endColumn": 52,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
Expand Down Expand Up @@ -14352,86 +14336,6 @@
"endColumn": 36,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 8,
"endColumn": 18,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 8,
"endColumn": 24,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 16,
"endColumn": 24,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 26,
"endColumn": 34,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 36,
"endColumn": 44,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 16,
"endColumn": 25,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 27,
"endColumn": 36,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 38,
"endColumn": 47,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 8,
"endColumn": 16,
"lineCount": 1
}
},
{
"code": "reportUnusedExpression",
"range": {
"startColumn": 8,
"endColumn": 11,
"lineCount": 1
}
}
],
"./sumpy/test/test_codegen.py": [
Expand Down Expand Up @@ -16764,8 +16668,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down Expand Up @@ -17057,38 +16961,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 16,
"endColumn": 67,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 21,
"endColumn": 60,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 8,
"endColumn": 25,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 8,
"endColumn": 15,
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
Expand Down Expand Up @@ -18062,8 +17934,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down Expand Up @@ -18664,8 +18536,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down Expand Up @@ -20114,8 +19986,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down Expand Up @@ -20284,8 +20156,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down Expand Up @@ -20414,8 +20286,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down Expand Up @@ -20984,8 +20856,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down Expand Up @@ -22650,8 +22522,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down Expand Up @@ -23054,8 +22926,8 @@
{
"code": "reportUnusedImport",
"range": {
"startColumn": 67,
"endColumn": 71,
"startColumn": 4,
"endColumn": 8,
"lineCount": 1
}
},
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/bench_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np

from pyopencl.tools import ( # noqa
from pyopencl.tools import ( # ruff:ignore[unused-import]
pytest_generate_tests_for_pyopencl as pytest_generate_tests,
)

Expand Down Expand Up @@ -53,7 +53,7 @@ class TranslationBenchmarkSuite:

def setup(self, param):
logging.basicConfig(level=logging.INFO)
np.random.seed(17) # noqa: NPY002
np.random.seed(17) # ruff:ignore[numpy-legacy-random]
if self.__class__ == TranslationBenchmarkSuite:
raise NotImplementedError
mpole_expn_class = self.mpole_expn_class
Expand Down
6 changes: 5 additions & 1 deletion contrib/translations/PDE-reduction and translations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"import sumpy.toys as t\n",
"from sumpy.expansion.local import VolumeTaylorLocalExpansion\n",
"from sumpy.expansion.multipole import VolumeTaylorMultipoleExpansion\n",
"from sumpy.kernel import HelmholtzKernel, LaplaceKernel, YukawaKernel # noqa: F401\n",
"from sumpy.kernel import ( # ruff:ignore[unused-import]\n",
" HelmholtzKernel,\n",
" LaplaceKernel,\n",
" YukawaKernel,\n",
")\n",
"\n",
"\n",
"rng = np.random.default_rng(seed=42)\n",
Expand Down
6 changes: 5 additions & 1 deletion contrib/translations/PDE-reduction-symbolic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
" LinearPDEConformingVolumeTaylorMultipoleExpansion,\n",
" VolumeTaylorMultipoleExpansion,\n",
")\n",
"from sumpy.kernel import HelmholtzKernel, LaplaceKernel, YukawaKernel # noqa: F401\n",
"from sumpy.kernel import ( # ruff:ignore[unused-import]\n",
" HelmholtzKernel,\n",
" LaplaceKernel,\n",
" YukawaKernel,\n",
")\n",
"from sumpy.symbolic import make_sym_vector\n",
"\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@


def setup(app):
app.connect("missing-reference", process_autodoc_missing_reference) # noqa: F821
app.connect("missing-reference", process_autodoc_missing_reference) # ruff:ignore[undefined-name]
8 changes: 6 additions & 2 deletions examples/expansion-toys.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import pyopencl as cl

import sumpy.toys as t
from sumpy.kernel import HelmholtzKernel, LaplaceKernel, YukawaKernel # noqa: F401
from sumpy.kernel import ( # ruff:ignore[unused-import]
HelmholtzKernel,
LaplaceKernel,
YukawaKernel,
)
from sumpy.visualization import FieldPlotter


Expand Down Expand Up @@ -40,7 +44,7 @@ def main():
plt.show()

mexp = t.multipole_expand(actx, pt_src, [0, 0], order=5)
mexp2 = t.multipole_expand(actx, mexp, [0, 0.25]) # noqa: F841
mexp2 = t.multipole_expand(actx, mexp, [0, 0.25]) # ruff:ignore[unused-variable]
lexp = t.local_expand(actx, mexp, [3, 0])
lexp2 = t.local_expand(actx, lexp, [3, 1], order=3)

Expand Down
2 changes: 1 addition & 1 deletion examples/fourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def make_fourier_mode_extender(m, n, dtype):
result = np.zeros((m, n), dtype)

# https://docs.scipy.org/doc/numpy/reference/routines.fft.html
if k % 2 == 0: # noqa: SIM108
if k % 2 == 0: # ruff:ignore[if-else-block-instead-of-if-exp]
peak_pos_freq = k/2
else:
peak_pos_freq = (k-1)/2
Expand Down
27 changes: 14 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ extend-select = [
"W", # pycodestyle
]
extend-ignore = [
"C90", # McCabe complexity
"E221", # multiple spaces before operator
"E226", # missing whitespace around arithmetic operator
"E402", # module-level import not at top of file
"RUF067", # non-empty-init-module
"TRY004",
"TRY300",
"complex-structure",
"missing-whitespace-around-arithmetic-operator",
"module-import-not-at-top-of-file",
"multiple-spaces-before-operator",
"non-empty-init-module",
"try-consider-else",
"type-check-without-type-error",
]

[tool.ruff.lint.flake8-quotes]
Expand All @@ -127,10 +127,10 @@ lines-after-imports = 2
required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.per-file-ignores]
"doc/**/*.py" = ["I002"]
"examples/**/*.py" = ["I002"]
"sumpy/test/test_*.py" = ["S102"]
"doc/conf.py" = ["S102"]
"doc/**/*.py" = ["missing-required-import"]
"examples/**/*.py" = ["missing-required-import"]
"sumpy/test/test_*.py" = ["exec-builtin"]
"doc/conf.py" = ["exec-builtin"]

[tool.typos.default]
extend-ignore-re = [
Expand Down Expand Up @@ -189,6 +189,9 @@ exclude = [
".venv",
]

# covered by ruff
reportUnusedImport = "hint"

[[tool.basedpyright.executionEnvironments]]
root = "test"
reportUnknownArgumentType = "none"
Expand All @@ -198,7 +201,6 @@ reportMissingParameterType = "none"
reportAttributeAccessIssue = "hint"
reportMissingTypeStubs = "hint"
reportUnknownLambdaType = "hint"
reportUnusedImport = "hint"
reportUnusedParameter = "none"
reportUnannotatedClassAttribute = "hint"
reportAny = "hint"
Expand All @@ -216,7 +218,6 @@ reportMissingParameterType = "none"
reportAttributeAccessIssue = "hint"
reportMissingTypeStubs = "hint"
reportUnknownLambdaType = "hint"
reportUnusedImport = "hint"
reportUnusedParameter = "none"
reportUnannotatedClassAttribute = "hint"
reportAny = "hint"
Expand Down
Loading
Loading