1818
1919__all__ = ["ImageAPITest" ]
2020
21+ DEFAULT_IMAGE_SHAPE = (100 , 150 )
22+
2123
2224class 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 :
0 commit comments