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
136 changes: 40 additions & 96 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
{
"files": {
"./examples/fmm-error.py": [
{
"code": "reportUnusedImport",
"range": {
"startColumn": 37,
"endColumn": 41,
"lineCount": 1
}
},
{
"code": "reportUnusedImport",
"range": {
"startColumn": 43,
"endColumn": 50,
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
Expand Down Expand Up @@ -745,14 +729,6 @@
}
],
"./examples/layerpot-3d.py": [
{
"code": "reportUnusedImport",
"range": {
"startColumn": 57,
"endColumn": 66,
"lineCount": 1
}
},
{
"code": "reportMissingParameterType",
"range": {
Expand Down Expand Up @@ -803,30 +779,6 @@
}
],
"./examples/layerpot.py": [
{
"code": "reportUnusedImport",
"range": {
"startColumn": 37,
"endColumn": 41,
"lineCount": 1
}
},
{
"code": "reportUnusedImport",
"range": {
"startColumn": 43,
"endColumn": 50,
"lineCount": 1
}
},
{
"code": "reportUnusedImport",
"range": {
"startColumn": 57,
"endColumn": 66,
"lineCount": 1
}
},
{
"code": "reportMissingParameterType",
"range": {
Expand Down Expand Up @@ -1385,14 +1337,6 @@
}
],
"./pytential/array_context.py": [
{
"code": "reportUnusedImport",
"range": {
"startColumn": 4,
"endColumn": 22,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
Expand Down Expand Up @@ -27913,22 +27857,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
"startColumn": 52,
"endColumn": 57,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 63,
"endColumn": 68,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
Expand Down Expand Up @@ -28141,14 +28069,6 @@
}
],
"./pytential/symbolic/dof_connection.py": [
{
"code": "reportUnusedImport",
"range": {
"startColumn": 16,
"endColumn": 18,
"lineCount": 1
}
},
{
"code": "reportUnreachable",
"range": {
Expand Down Expand Up @@ -28633,14 +28553,6 @@
"lineCount": 1
}
},
{
"code": "reportAbstractUsage",
"range": {
"startColumn": 19,
"endColumn": 18,
"lineCount": 4
}
},
{
"code": "reportCallIssue",
"range": {
Expand Down Expand Up @@ -28769,14 +28681,6 @@
"lineCount": 1
}
},
{
"code": "reportAbstractUsage",
"range": {
"startColumn": 19,
"endColumn": 18,
"lineCount": 4
}
},
{
"code": "reportCallIssue",
"range": {
Expand Down Expand Up @@ -43997,6 +43901,14 @@
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 97,
"endColumn": 117,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
Expand All @@ -44005,6 +43917,38 @@
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 12,
"endColumn": 18,
"lineCount": 1
}
},
{
"code": "reportOptionalSubscript",
"range": {
"startColumn": 21,
"endColumn": 48,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 49,
"endColumn": 70,
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
"startColumn": 49,
"endColumn": 55,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
Expand Down
8 changes: 4 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"P2P": "class:sumpy.p2p.P2P",
"P2PBase": "class:sumpy.p2p.P2PBase",
"FMMLevelToOrder": "class:sumpy.fmm.FMMLevelToOrder",
"MultipoleExpansionFromOrderFactory": "class:sumpy.fmm.MultipoleExpansionFromOrderFactory", # noqa: E501
"MultipoleExpansionFromOrderFactory": "class:sumpy.fmm.MultipoleExpansionFromOrderFactory", # ruff:ignore[line-too-long]
"LocalExpansionFromOrderFactory": "class:sumpy.fmm.LocalExpansionFromOrderFactory",
# pytential
"DOFDescriptorLike": "data:pytential.symbolic.dof_desc.DOFDescriptorLike",
Expand All @@ -123,13 +123,13 @@
"Side": "obj:pytential.symbolic.primitives.Side",
"TargetOrDiscretization": "obj:pytential.target.TargetOrDiscretization",
"VectorExpression": "obj:pytential.symbolic.pde.scalar.VectorExpression",
"pytential.symbolic.dof_desc.DOFDescriptorLike": "data:pytential.symbolic.dof_desc.DOFDescriptorLike", # noqa: E501
"pytential.symbolic.primitives.ExpressionNode": "class:pytential.symbolic.primitives.ExpressionNode", # noqa: E501
"pytential.symbolic.dof_desc.DOFDescriptorLike": "data:pytential.symbolic.dof_desc.DOFDescriptorLike", # ruff:ignore[line-too-long]
"pytential.symbolic.primitives.ExpressionNode": "class:pytential.symbolic.primitives.ExpressionNode", # ruff:ignore[line-too-long]
"sym.DOFDescriptor": "class:pytential.symbolic.dof_desc.DOFDescriptor",
"sym.IntG": "class:pytential.symbolic.primitives.IntG",
"sym.var": "obj:pytential.symbolic.primitives.var",
}


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]
7 changes: 6 additions & 1 deletion examples/fmm-error.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import numpy as np

from meshmode.mesh.generation import drop, ellipse, make_curve_mesh, starfish # noqa
from meshmode.mesh.generation import ( # ruff:ignore[unused-import]
drop,
ellipse,
make_curve_mesh,
starfish,
)
from sumpy.kernel import HelmholtzKernel, LaplaceKernel
from sumpy.visualization import FieldPlotter

Expand Down
6 changes: 5 additions & 1 deletion examples/layerpot-3d.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import numpy as np

from sumpy.kernel import HelmholtzKernel, LaplaceKernel, OneKernel # noqa
from sumpy.kernel import ( # ruff:ignore[unused-import]
HelmholtzKernel,
LaplaceKernel,
OneKernel,
)
from sumpy.visualization import FieldPlotter

from pytential import bind, sym
Expand Down
12 changes: 10 additions & 2 deletions examples/layerpot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import numpy as np

from meshmode.mesh.generation import drop, ellipse, starfish # noqa: F401
from sumpy.kernel import HelmholtzKernel, LaplaceKernel, OneKernel # noqa: F401
from meshmode.mesh.generation import ( # ruff:ignore[unused-import]
drop,
ellipse,
starfish,
)
from sumpy.kernel import ( # ruff:ignore[unused-import]
HelmholtzKernel,
LaplaceKernel,
OneKernel,
)
from sumpy.visualization import FieldPlotter

from pytential import bind, sym
Expand Down
26 changes: 14 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ extend-select = [
]
extend-ignore = [
"C90", # McCabe complexity
"E226", # missing whitespace around arithmetic operator
"E402", # module level import not at the top of file
"N802", # function name should be lowercase
"N803", # argument name should be lowercase
"N806", # variable name should be lowercase
"RUF067", # non-empty-init-module
"UP031", # use f-strings instead of %
"UP032", # use f-strings instead of .format
"missing-whitespace-around-arithmetic-operator",
"module-import-not-at-top-of-file",
"invalid-function-name",
"invalid-argument-name",
"non-lowercase-variable-in-function",
"non-empty-init-module",
"printf-string-formatting",
"f-string",
]
exclude = [
"experiments/*.py",
Expand All @@ -107,9 +107,9 @@ exclude = [
]

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

[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
Expand Down Expand Up @@ -162,6 +162,9 @@ reportImportCycles = "none"

reportPrivateUsage = "hint"

# covered by ruff
reportUnusedImport = "none"

pythonVersion = "3.12"
pythonPlatform = "All"

Expand Down Expand Up @@ -199,4 +202,3 @@ reportPrivateImportUsage = "hint"
reportPrivateUsage = "hint"
reportUnknownLambdaType = "hint"
reportMissingTypeStubs = "hint"
reportUnusedImport = "none"
2 changes: 1 addition & 1 deletion pytential/array_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
_PytestPyOpenCLArrayContextFactoryWithClass,
register_pytest_array_context_factory,
)
from sumpy.array_context import ( # noqa: F401
from sumpy.array_context import ( # ruff:ignore[unused-import]
PyOpenCLArrayContext as PyOpenCLArrayContextBase,
make_loopy_program,
)
Expand Down
4 changes: 2 additions & 2 deletions pytential/linalg/direct_solver_symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@

# {{{ utils

class PROXY_SKELETONIZATION_SOURCE: # noqa: N801
class PROXY_SKELETONIZATION_SOURCE: # ruff:ignore[invalid-class-name]
pass


class PROXY_SKELETONIZATION_TARGET: # noqa: N801
class PROXY_SKELETONIZATION_TARGET: # ruff:ignore[invalid-class-name]
pass


Expand Down
4 changes: 2 additions & 2 deletions pytential/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@

# {{{ constants

class colors: # noqa
class colors: # ruff:ignore[invalid-class-name]
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)


class term_seq: # noqa
class term_seq: # ruff:ignore[invalid-class-name]
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
Expand Down
2 changes: 1 addition & 1 deletion pytential/qbx/cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def get_kernel():
nqbx_centers += global_qbx_center_weight[iparticle];

nqbx_centers_itgt_box[i] = nqbx_centers;
""").render( # noqa: E501
""").render( # ruff:ignore[line-too-long]
box_id_t=dtype_to_ctype(box_id_dtype),
particle_id_t=dtype_to_ctype(particle_id_dtype)
),
Expand Down
2 changes: 1 addition & 1 deletion pytential/qbx/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

# {{{ code getter

class target_state(Enum): # noqa
class target_state(Enum): # ruff:ignore[invalid-class-name]
"""This enumeration contains special values that are used in
the array returned by :meth:`QBXFMMGeometryData.user_target_to_center`.

Expand Down
4 changes: 2 additions & 2 deletions pytential/qbx/target_assoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@

# {{{ kernels

class target_status_enum(Enum): # noqa
class target_status_enum(Enum): # ruff:ignore[invalid-class-name]
c_name = "TargetStatus"
dtype = np.dtype(np.int32)
c_value_prefix = ""
Expand All @@ -160,7 +160,7 @@ class target_status_enum(Enum): # noqa
MARKED_QBX_CENTER_FOUND = 2


class target_flag_enum(Enum): # noqa
class target_flag_enum(Enum): # ruff:ignore[invalid-class-name]
c_name = "TargetFlag"
dtype = np.dtype(np.int32)
c_value_prefix = ""
Expand Down
Loading
Loading