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 21, 2024
1 parent da737ad commit 856905c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions boxtree/tree_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ def my_realloc_zeros_nocopy(ary, shape=nboxes_guess):
wait_for.extend(have_upper_level_split_box.events)

# writes: force_split_box, have_upper_level_split_box
evt = level_restrict_kernel(
evt = level_restrict_kernel( # pylint: disable=possibly-used-before-assignment # noqa: E501
upper_level,
root_extent,
box_has_children,
Expand Down Expand Up @@ -1451,8 +1451,8 @@ def make_arange(start, offset=level_used_box_count):
box_target_starts, box_target_counts_cumul,
)
+ ((
box_source_counts_nonchild,
box_target_counts_nonchild,
box_source_counts_nonchild, # pylint: disable=possibly-used-before-assignment # noqa: E501
box_target_counts_nonchild, # pylint: disable=possibly-used-before-assignment # noqa: E501
) if srcntgts_have_extent else ())
),
queue=queue, range=slice(nsrcntgts),
Expand Down
2 changes: 1 addition & 1 deletion test/test_fmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def test_fmm_completeness(actx_factory, dims, nsources_req, ntargets_req,
from boxtree.visualization import draw_box_lists
draw_box_lists(
plotter,
pre_merge_host_trav if who_has_extent else host_trav,
pre_merge_host_trav if who_has_extent else host_trav, # pylint: disable=possibly-used-before-assignment # noqa: E501
22)
# from boxtree.visualization import draw_same_level_non_well_sep_boxes
# draw_same_level_non_well_sep_boxes(plotter, host_trav, 2)
Expand Down
2 changes: 1 addition & 1 deletion test/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def run_build_test(builder, actx, dims, dtype, nparticles, visualize,
else:
assert refine_weights is not None
box_weight = np.sum(
refine_weights_reordered[start:start+nparticles_in_box])
refine_weights_reordered[start:start+nparticles_in_box]) # pylint: disable=possibly-used-before-assignment # noqa: E501
if box_weight > max_leaf_refine_weight:
print("refine weight exceeded ({} > {}); box {}".format(
box_weight, max_leaf_refine_weight, ibox))
Expand Down

0 comments on commit 856905c

Please sign in to comment.