Skip to content

Commit

Permalink
Ignore false-positive use-before-assign warnings from pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed May 20, 2024
1 parent 66f4131 commit 5b73a07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pytential/linalg/gmres.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def norm(x):
if recalc_r:
r = b - a_call(x)

norm_r = norm(r)
norm_r = norm(r) # pylint: disable=possibly-used-before-assignment
residual_norms.append(norm_r)

if callback is not None:
Expand Down
13 changes: 7 additions & 6 deletions pytential/qbx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,11 +887,12 @@ def _flat_centers(dofdesc, qbx_forced_limit):
flat_target_nodes = _flat_nodes(target_name)

# FIXME: (Somewhat wastefully) compute P2P for all targets
evt, output_for_each_kernel = p2p(queue,
targets=flat_target_nodes,
sources=flat_source_nodes,
strength=flat_strengths,
**flat_kernel_args)
evt, output_for_each_kernel = p2p( # pylint: disable=possibly-used-before-assignment # noqa: E501
queue,
targets=flat_target_nodes,
sources=flat_source_nodes,
strength=flat_strengths,
**flat_kernel_args)

target_discrs_and_qbx_sides = ((target_discr, qbx_forced_limit),)
geo_data = self.qbx_fmm_geometry_data(
Expand Down Expand Up @@ -929,7 +930,7 @@ def _flat_centers(dofdesc, qbx_forced_limit):
tgt_subset_kwargs[f"result_{i}"] = res_i

if qbx_tgt_count:
lpot_applier_on_tgt_subset(
lpot_applier_on_tgt_subset( # pylint: disable=possibly-used-before-assignment # noqa: E501
queue,
targets=flat_target_nodes,
sources=flat_source_nodes,
Expand Down

0 comments on commit 5b73a07

Please sign in to comment.