Skip to content

Commit fb13f6d

Browse files
committed
Remove image_height and image_width
1 parent 79e13c1 commit fb13f6d

File tree

3 files changed

+6
-27
lines changed

3 files changed

+6
-27
lines changed

src/astro_image_display_api/api_test.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818

1919
__all__ = ["ImageAPITest"]
2020

21+
DEFAULT_IMAGE_SHAPE = (100, 150)
22+
2123

2224
class ImageAPITest:
2325
@pytest.fixture
2426
def data(self):
2527
rng = np.random.default_rng(1234)
26-
return rng.random((100, 150))
28+
return rng.random(DEFAULT_IMAGE_SHAPE)
2729

2830
@pytest.fixture
2931
def wcs(self):
@@ -49,8 +51,8 @@ def catalog(self, wcs: WCS) -> Table:
4951
expected columns.
5052
"""
5153
rng = np.random.default_rng(45328975)
52-
x = rng.uniform(0, self.image.image_width, size=10)
53-
y = rng.uniform(0, self.image.image_height, size=10)
54+
x = rng.uniform(0, DEFAULT_IMAGE_SHAPE[0], size=10)
55+
y = rng.uniform(0, DEFAULT_IMAGE_SHAPE[1], size=10)
5456
coord = wcs.pixel_to_world(x, y)
5557

5658
cat = Table(
@@ -70,7 +72,7 @@ def setup(self):
7072
Subclasses MUST define ``image_widget_class`` -- doing so as a
7173
class variable does the trick.
7274
"""
73-
self.image = self.image_widget_class(image_width=250, image_height=100)
75+
self.image = self.image_widget_class()
7476

7577
def _assert_empty_catalog_table(self, table):
7678
assert isinstance(table, Table)
@@ -81,17 +83,6 @@ def _get_catalog_names_as_set(self):
8183
marks = self.image.catalog_names
8284
return set(marks)
8385

84-
def test_width_height(self):
85-
assert self.image.image_width == 250
86-
assert self.image.image_height == 100
87-
88-
width = 200
89-
height = 300
90-
self.image.image_width = width
91-
self.image.image_height = height
92-
assert self.image.image_width == width
93-
assert self.image.image_height == height
94-
9586
@pytest.mark.parametrize("load_type", ["fits", "nddata", "array"])
9687
def test_load(self, data, tmp_path, load_type):
9788
match load_type:

src/astro_image_display_api/image_viewer_logic.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ class ImageViewerLogic:
6060
state to simulate the behavior of a real viewer.
6161
"""
6262

63-
# These are attributes, not methods. The type annotations are there
64-
# to make sure Protocol knows they are attributes. Python does not
65-
# do any checking at all of these types.
66-
image_width: int = 0
67-
image_height: int = 0
68-
zoom_level: float = 1
6963
_cuts: BaseInterval | tuple[float, float] = AsymmetricPercentileInterval(
7064
upper_percentile=95
7165
)

src/astro_image_display_api/interface_definition.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515

1616
@runtime_checkable
1717
class ImageViewerInterface(Protocol):
18-
# These are attributes, not methods. The type annotations are there
19-
# to make sure Protocol knows they are attributes. Python does not
20-
# do any checking at all of these types.
21-
image_width: int
22-
image_height: int
23-
2418
# The methods, grouped loosely by purpose
2519

2620
# Method for loading image data

0 commit comments

Comments
 (0)