Skip to content

Commit

Permalink
fix(pylint): silence false pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Oct 9, 2024
1 parent 5a7d513 commit d546971
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@
"pytools": ("https://documen.tician.de/pytools", None),
"scipy": ("https://docs.scipy.org/doc/scipy", None),
"sumpy": ("https://documen.tician.de/sumpy", None),
"sympy": ("https://docs.sympy.org/latest/", None),
}
18 changes: 17 additions & 1 deletion pytential/symbolic/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
:class:`~meshmode.dof_array.DOFArray` is used and otherwise
:class:`~pyopencl.array.Array` is used.
.. autoclass:: Expression
Diagnostics
^^^^^^^^^^^
Expand Down Expand Up @@ -228,6 +230,8 @@
"""

__all__ = (
"Expression",

"ErrorExpression",

"var", "SpatialConstant", "make_sym_mv", "make_sym_surface_mv",
Expand Down Expand Up @@ -306,6 +310,12 @@ def array_to_tuple(ary):

@expr_dataclass()
class Expression(ExpressionBase):
"""Bases: :class:`~pymbolic.primitives.Expression`.
A subclass of :class:`~pymbolic.primitives.Expression` for use with
:mod:`pytential` mappers.
"""

def make_stringifier(self, originating_stringifier=None):
from pytential.symbolic.mappers import StringifyMapper
return StringifyMapper()
Expand Down Expand Up @@ -1405,15 +1415,21 @@ class IntG(Expression):
fail if no QBX center is found. To allow potential evaluation at the target
to succeeds even if no applicable QBX center is found use ``±2``.
"""

# pylint: disable-next=invalid-field-call
source: DOFDescriptor = field(default_factory=lambda: EMPTY_DESCRIPTOR)
"""The symbolic name of the source discretization. This name is bound to a
concrete :class:`~pytential.source.LayerPotentialSourceBase`
by :func:`pytential.bind`.
"""

# pylint: disable-next=invalid-field-call
target: DOFDescriptor = field(default_factory=lambda: EMPTY_DESCRIPTOR)
"""The symbolic name of the set of targets. This name gets assigned to a
concrete target set by :func:`pytential.bind`.
"""

# pylint: disable-next=invalid-field-call
kernel_arguments: Dict[str, Operand] = field(default_factory=dict)
"""A dictionary mapping named :class:`~sumpy.kernel.Kernel` arguments
(see :meth:`~sumpy.kernel.Kernel.get_args` and
Expand Down Expand Up @@ -1475,7 +1491,7 @@ def __post_init__(self) -> None:
for karg in (kernel.get_args() + kernel.get_source_args()):
kernel_arg_names.add(karg.loopy_arg.name)

provided_arg_names = set(self.kernel_arguments.keys())
provided_arg_names = set(self.kernel_arguments.keys()) # pylint: disable=no-member
missing_args = kernel_arg_names - provided_arg_names
if missing_args:
raise ValueError(
Expand Down

0 comments on commit d546971

Please sign in to comment.