Skip to content

Commit

Permalink
[Maint] drop unused n_dimensional property of Labels (#7389)
Browse files Browse the repository at this point in the history
# References and relevant issues
`n_dimensional` was removed in
#3377

# Description
I came across a reference to `n_dimensional` in the docs and realized it
didn't exist.
In this PR I remove it from the test and example.
Here's the docs PR where I also switch to the proper property:
napari/docs#522

Co-authored-by: Draga Doncila Pop <[email protected]>
  • Loading branch information
psobolewskiPhD and DragaDoncila authored Nov 21, 2024
1 parent 0505d6d commit 6842004
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion examples/paint-nd.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
labels.n_edit_dimensions = 3
labels.brush_size = 15
labels.mode = 'paint'
labels.n_dimensional = True

if __name__ == '__main__':
napari.run()
8 changes: 4 additions & 4 deletions napari/layers/labels/_tests/test_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,15 +1018,15 @@ def test_world_data_extent():
'mode',
'selected_label',
'preserve_labels',
'n_dimensional',
'n_edit_dimensions',
),
list(
itertools.product(
list(range(1, 22, 5)),
['fill', 'erase', 'paint'],
[1, 20, 100],
[True, False],
[True, False],
[3, 2],
)
),
)
Expand All @@ -1035,7 +1035,7 @@ def test_undo_redo(
mode,
selected_label,
preserve_labels,
n_dimensional,
n_edit_dimensions,
):
blobs = sk_data.binary_blobs(length=64, volume_fraction=0.3, n_dim=3)
layer = Labels(blobs)
Expand All @@ -1044,7 +1044,7 @@ def test_undo_redo(
layer.mode = mode
layer.selected_label = selected_label
layer.preserve_labels = preserve_labels
layer.n_edit_dimensions = 3 if n_dimensional else 2
layer.n_edit_dimensions = n_edit_dimensions
coord = np.random.random((3,)) * (np.array(blobs.shape) - 1)
while layer.data[tuple(coord.astype(int))] == 0 and np.any(layer.data):
coord = np.random.random((3,)) * (np.array(blobs.shape) - 1)
Expand Down

0 comments on commit 6842004

Please sign in to comment.