Skip to content

Commit c752e36

Browse files
committed
Change load → load_image
1 parent c894893 commit c752e36

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/astro_image_display_api/dummy_viewer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def cursor(self, value: str) -> None:
113113
# The methods, grouped loosely by purpose
114114

115115
# Methods for loading data
116-
def load(self, file: str | os.PathLike | ArrayLike | NDData) -> None:
116+
def load_image(self, file: str | os.PathLike | ArrayLike | NDData) -> None:
117117
"""
118118
Load a FITS file into the viewer.
119119

src/astro_image_display_api/interface_definition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class ImageViewerInterface(Protocol):
5252

5353
# The methods, grouped loosely by purpose
5454

55-
# Method for loading data
55+
# Method for loading image data
5656
@abstractmethod
57-
def load(self, data: Any) -> None:
57+
def load_image(self, data: Any) -> None:
5858
"""
5959
Load data into the viewer. At a minimum, this should allow a FITS file
6060
to be loaded. Viewers may allow additional data types to be loaded, such as

src/astro_image_display_api/widget_api_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_load(self, data, tmp_path, load_type):
9090
case "array":
9191
load_arg = data
9292

93-
self.image.load(load_arg)
93+
self.image.load_image(load_arg)
9494

9595
def test_center_on(self):
9696
self.image.center_on((10, 10)) # X, Y
@@ -103,7 +103,7 @@ def test_offset_by(self, data, wcs):
103103
# an NDData that has a WCS.
104104
ndd = NDData(data=data, wcs=wcs)
105105
# TODO: THIS WOULD FAIL ON A VIEWER THAT DOES NOT ALLOW NDDATA OR ARRAY LOADING
106-
self.image.load(ndd)
106+
self.image.load_image(ndd)
107107

108108
self.image.offset_by(10 * u.arcmin, 10 * u.arcmin)
109109

@@ -118,7 +118,7 @@ def test_offset_by(self, data, wcs):
118118
def test_zoom_level(self, data):
119119
# Set data first, since that is needed to determine zoom level
120120
# TODO: THIS WOULD FAIL ON A VIEWER THAT DOES NOT ALLOW NDDATA OR ARRAY LOADING
121-
self.image.load(data)
121+
self.image.load_image(data)
122122
self.image.zoom_level = 5
123123
assert self.image.zoom_level == 5
124124

@@ -253,7 +253,7 @@ def test_remove_marker_accepts_list(self):
253253
def test_adding_markers_as_world(self, data, wcs):
254254
ndd = NDData(data=data, wcs=wcs)
255255
# TODO: THIS WOULD FAIL ON A VIEWER THAT DOES NOT ALLOW NDDATA OR ARRAY LOADING
256-
self.image.load(ndd)
256+
self.image.load_image(ndd)
257257

258258
# Add markers using world coordinates
259259
pixels = np.linspace(0, 100, num=10).reshape(5, 2)
@@ -300,7 +300,7 @@ def test_cuts(self, data):
300300

301301
# Setting using histogram requires data
302302
# TODO: THIS WOULD FAIL ON A VIEWER THAT DOES NOT ALLOW NDDATA OR ARRAY LOADING
303-
self.image.load(data)
303+
self.image.load_image(data)
304304
self.image.cuts = 'histogram'
305305
assert len(self.image.cuts) == 2
306306

0 commit comments

Comments
 (0)