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
2 changes: 1 addition & 1 deletion sumpy/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def map_constant(self, expr: object, /) -> Expression:

complex_dtype = self.complex_dtype
if complex_dtype is None:
if complex(np.complex64(expr)) == expr:
if complex(np.complex64(expr)) == expr: # noqa: RUF069
return np.complex64(expr)

complex_dtype = np.complex128
Expand Down
4 changes: 2 additions & 2 deletions sumpy/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def __new__(cls,
viscosity_mu: float | str | SpatialConstant = "mu",
poisson_ratio: float | str | SpatialConstant = "nu",
) -> ElasticityKernel:
if poisson_ratio == 0.5:
if poisson_ratio == 0.5: # noqa: RUF069
return super().__new__(StokesletKernel)
else:
return super().__new__(cls)
Expand Down Expand Up @@ -896,7 +896,7 @@ def __init__(self,
if poisson_ratio is None:
poisson_ratio = 0.5

if poisson_ratio != 0.5:
if poisson_ratio != 0.5: # noqa: RUF069
raise ValueError(
"'StokesletKernel' must have a Poisson ratio of 0.5: "
f"got '{poisson_ratio}'")
Expand Down
4 changes: 2 additions & 2 deletions sumpy/test/test_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,14 +695,14 @@ def test_m2m_and_l2l_exprs_simpler(base_knl, local_expn_class, mpole_expn_class,
dvec, tgt_rscale, _fast_version=False)

for expr1, expr2 in zip(faster_m2m, slower_m2m, strict=True):
assert float(sym.doit(expr1 - expr2).expand()) == 0.0
assert float(sym.doit(expr1 - expr2).expand()) == 0.0 # noqa: RUF069

faster_l2l = local_expn.translate_from(local_expn, src_coeff_exprs, src_rscale,
dvec, tgt_rscale)
slower_l2l = local_expn.translate_from(local_expn, src_coeff_exprs, src_rscale,
dvec, tgt_rscale, _fast_version=False)
for expr1, expr2 in zip(faster_l2l, slower_l2l, strict=True):
assert float(sym.doit(expr1 - expr2).expand()) == 0.0
assert float(sym.doit(expr1 - expr2).expand()) == 0.0 # noqa: RUF069

# }}}

Expand Down
Loading