Skip to content

Commit

Permalink
npy autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
Czaki committed Mar 1, 2023
1 parent 82d419d commit 003fbc2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions napari/_vispy/experimental/_tests/test_vispy_tiled_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_tiled_screenshot(qtbot, monkeypatch, make_napari_viewer, dtype):

# Take the screenshot
screenshot = viewer.screenshot(canvas_only=True, flash=False)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(np.int)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(int)
target_center = np.array([0, 0, 128, 255], dtype='uint8')
target_edge = np.array([0, 0, 0, 255], dtype='uint8')
screen_offset = 3 # Offset is needed as our screenshots have black borders
Expand Down Expand Up @@ -98,7 +98,7 @@ def test_tiled_rgb(qtbot, monkeypatch, make_napari_viewer):

# Take the screenshot
screenshot = viewer.screenshot(canvas_only=True, flash=False)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(np.int)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(int)
target_center = np.array([128, 128, 128, 255], dtype='uint8')
target_edge = np.array([0, 0, 0, 255], dtype='uint8')
screen_offset = 3 # Offset is needed as our screenshots have black borders
Expand Down Expand Up @@ -144,7 +144,7 @@ def test_tiled_changing_contrast_limits(

# Take the screenshot
screenshot = viewer.screenshot(canvas_only=True, flash=False)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(np.int)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(int)
target_center = np.array([0, 0, 255, 255], dtype='uint8')
target_edge = np.array([0, 0, 0, 255], dtype='uint8')
screen_offset = 3 # Offset is needed as our screenshots have black borders
Expand Down Expand Up @@ -198,7 +198,7 @@ def test_tiled_single_scale(qtbot, monkeypatch, make_napari_viewer):

# Take the screenshot
screenshot = viewer.screenshot(canvas_only=True, flash=False)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(np.int)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(int)
target_center = np.array([128, 128, 128, 255], dtype='uint8')
screen_offset = 3 # Offset is needed as our screenshots have black borders

Expand Down Expand Up @@ -239,7 +239,7 @@ def test_tiled_labels(qtbot, monkeypatch, make_napari_viewer):

# Take the screenshot
screenshot = viewer.screenshot(canvas_only=True, flash=False)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(np.int)
center_coord = np.round(np.array(screenshot.shape[:2]) / 2).astype(int)
col = layer.get_color(1)
target_center = np.array([c * 255 for c in col], dtype='uint8')
target_edge = np.array([0, 0, 0, 255], dtype='uint8')
Expand Down
2 changes: 1 addition & 1 deletion napari/layers/image/experimental/octree_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _create_chunk(self, row: int, col: int) -> OctreeChunk:
# Create OctreeChunkGeom used by the visual for rendering this
# chunk. Size it based on the base image pixels, not based on the
# data in this level, so it's exact.
base = np.array(meta.base_shape[::-1], dtype=np.float)
base = np.array(meta.base_shape[::-1], dtype=float)
remain = base - pos
size = np.minimum(remain, [scaled_size, scaled_size])
geom = OctreeChunkGeom(pos, size)
Expand Down
4 changes: 2 additions & 2 deletions napari/layers/shapes/_shape_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ def to_labels(self, labels_shape=None, zoom_factor=1, offset=(0, 0)):
integer up to N for points inside the corresponding shape.
"""
if labels_shape is None:
labels_shape = self.displayed_vertices.max(axis=0).astype(np.int)
labels_shape = self.displayed_vertices.max(axis=0).astype(int)

labels = np.zeros(labels_shape, dtype=int)

Expand Down Expand Up @@ -1226,7 +1226,7 @@ def to_colors(
value of the shape for points inside the corresponding shape.
"""
if colors_shape is None:
colors_shape = self.displayed_vertices.max(axis=0).astype(np.int)
colors_shape = self.displayed_vertices.max(axis=0).astype(int)

colors = np.zeros((*tuple(colors_shape), 4), dtype=float)
colors[..., 3] = 1
Expand Down

0 comments on commit 003fbc2

Please sign in to comment.