Skip to content

Commit 6f6dab2

Browse files
committed
Remove autocut_options and stretch_options
1 parent a64f20b commit 6f6dab2

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

src/astro_image_display_api/dummy_viewer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class ImageViewer:
2929
image_width: int = 0
3030
image_height: int = 0
3131
zoom_level: float = 1
32-
stretch_options: tuple = ("linear", "log", "sqrt")
33-
autocut_options: tuple = ("minmax", "zscale", "asinh", "percentile", "histogram")
3432
_cursor: str = ImageViewerInterface.ALLOWED_CURSOR_LOCATIONS[0]
3533
marker: Any = "marker"
3634
_cuts: str | tuple[float, float] = (0, 1)
@@ -81,7 +79,7 @@ def stretch(self) -> BaseStretch:
8179
@stretch.setter
8280
def stretch(self, value: BaseStretch) -> None:
8381
if not isinstance(value, BaseStretch):
84-
raise ValueError(f"Stretch option {value} is not valid. Must be one of {self.stretch_options}.")
82+
raise ValueError(f"Stretch option {value} is not valid. Must be an Astropy.visualization Stretch object.")
8583
self._stretch = value
8684

8785
@property

src/astro_image_display_api/interface_definition.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ class ImageViewerInterface(Protocol):
3434
image_width: int
3535
image_height: int
3636
zoom_level: float
37-
stretch_options: tuple
38-
autocut_options: tuple
3937
cursor: str
4038
marker: Any
4139
cuts: tuple | BaseInterval

src/astro_image_display_api/widget_api_test.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,9 @@ def test_adding_markers_as_world(self, data, wcs):
270270
mark_coord_table['coord'].dec.deg)
271271

272272
def test_stretch(self):
273-
# Check that the stretch options is not an empty list
274-
assert len(self.image.stretch_options) > 0
275-
276273
original_stretch = self.image.stretch
277274

278-
with pytest.raises(ValueError, match='[mM]ust be one of'):
275+
with pytest.raises(ValueError, match=r'Stretch.*not valid.*'):
279276
self.image.stretch = 'not a valid value'
280277

281278
# A bad value should leave the stretch unchanged
@@ -287,7 +284,6 @@ def test_stretch(self):
287284
assert isinstance(self.image.stretch, LogStretch)
288285

289286
def test_cuts(self, data):
290-
assert len(self.image.autocut_options) > 0
291287
with pytest.raises(ValueError, match='[mM]ust be'):
292288
self.image.cuts = 'not a valid value'
293289

0 commit comments

Comments
 (0)