Skip to content

Commit e20be84

Browse files
committed
Remove autocut_options and stretch_options
1 parent 692e74b commit e20be84

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
@@ -26,8 +26,6 @@ class ImageViewer:
2626
image_width: int = 0
2727
image_height: int = 0
2828
zoom_level: float = 1
29-
stretch_options: tuple = ("linear", "log", "sqrt")
30-
autocut_options: tuple = ("minmax", "zscale", "asinh", "percentile", "histogram")
3129
_cursor: str = ImageViewerInterface.ALLOWED_CURSOR_LOCATIONS[0]
3230
marker: Any = "marker"
3331
_cuts: str | tuple[float, float] = (0, 1)
@@ -57,7 +55,7 @@ def stretch(self) -> BaseStretch:
5755
@stretch.setter
5856
def stretch(self, value: BaseStretch) -> None:
5957
if not isinstance(value, BaseStretch):
60-
raise ValueError(f"Stretch option {value} is not valid. Must be one of {self.stretch_options}.")
58+
raise ValueError(f"Stretch option {value} is not valid. Must be an Astropy.visualization Stretch object.")
6159
self._stretch = value
6260

6361
@property

src/astro_image_display_api/interface_definition.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class ImageViewerInterface(Protocol):
3131
image_width: int
3232
image_height: int
3333
zoom_level: float
34-
stretch_options: tuple
35-
autocut_options: tuple
3634
cursor: str
3735
marker: Any
3836
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
@@ -269,12 +269,9 @@ def test_adding_markers_as_world(self, data, wcs):
269269
mark_coord_table['coord'].dec.deg)
270270

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

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

280277
# A bad value should leave the stretch unchanged
@@ -286,7 +283,6 @@ def test_stretch(self):
286283
assert isinstance(self.image.stretch, LogStretch)
287284

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

0 commit comments

Comments
 (0)