Skip to content

Commit 42e9b21

Browse files
committed
Fixed unit tests from refactor renames
1 parent a074b05 commit 42e9b21

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

autoarray/simulator/simulator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def lsst(
7171
psf = kernel.Kernel.from_gaussian(
7272
shape_2d=psf_shape_2d, sigma=psf_sigma, pixel_scales=pixel_scales
7373
)
74-
return ImagingSimulator(
74+
return cls(
7575
shape_2d=shape,
7676
pixel_scales=pixel_scales,
7777
sub_size=sub_size,
@@ -103,7 +103,7 @@ def euclid(
103103
psf = kernel.Kernel.from_gaussian(
104104
shape_2d=psf_shape_2d, sigma=psf_sigma, pixel_scales=pixel_scales
105105
)
106-
return ImagingSimulator(
106+
return cls(
107107
shape_2d=shape,
108108
pixel_scales=pixel_scales,
109109
sub_size=sub_size,
@@ -135,7 +135,7 @@ def hst(
135135
psf = kernel.Kernel.from_gaussian(
136136
shape_2d=psf_shape_2d, sigma=psf_sigma, pixel_scales=pixel_scales
137137
)
138-
return ImagingSimulator(
138+
return cls(
139139
shape_2d=shape,
140140
pixel_scales=pixel_scales,
141141
sub_size=sub_size,
@@ -168,7 +168,7 @@ def hst_up_sampled(
168168
psf = kernel.Kernel.from_gaussian(
169169
shape_2d=psf_shape_2d, sigma=psf_sigma, pixel_scales=pixel_scales
170170
)
171-
return ImagingSimulator(
171+
return cls(
172172
shape_2d=shape,
173173
pixel_scales=pixel_scales,
174174
sub_size=sub_size,
@@ -200,7 +200,7 @@ def keck_adaptive_optics(
200200
psf = kernel.Kernel.from_gaussian(
201201
shape_2d=psf_shape_2d, sigma=psf_sigma, pixel_scales=pixel_scales
202202
)
203-
return ImagingSimulator(
203+
return cls(
204204
shape_2d=shape,
205205
pixel_scales=pixel_scales,
206206
sub_size=sub_size,
@@ -344,7 +344,7 @@ def sma(
344344
else:
345345
primary_beam = None
346346

347-
return InterferometerSimulator(
347+
return cls(
348348
real_space_shape_2d=real_space_shape_2d,
349349
real_space_pixel_scales=real_space_pixel_scales,
350350
uv_wavelengths=uv_wavelengths,

test_autoarray/unit/operators/test_fourier_transform.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class TestVisiblities(object):
88
def test__real_visibilities__intensity_image_all_ones__simple_cases(self):
99

1010
uv_wavelengths = np.ones(shape=(4, 2))
11-
grid_radians = np.ones(shape=(1, 2))
11+
grid_radians = aa.grid.manual_2d([[[1.0, 1.0]]])
1212

1313
transformer = aa.transformer(
1414
uv_wavelengths=uv_wavelengths,
@@ -24,7 +24,7 @@ def test__real_visibilities__intensity_image_all_ones__simple_cases(self):
2424

2525
uv_wavelengths = np.array([[0.2, 1.0], [0.5, 1.1], [0.8, 1.2]])
2626

27-
grid_radians = np.array([[0.1, 0.2], [0.3, 0.4]])
27+
grid_radians = aa.grid.manual_2d([[[0.1, 0.2], [0.3, 0.4]]])
2828

2929
transformer = aa.transformer(
3030
uv_wavelengths=uv_wavelengths,
@@ -43,7 +43,7 @@ def test__real_visibilities__intensity_image_all_ones__simple_cases(self):
4343
def test__real_visibilities__intensity_image_varies__simple_cases(self):
4444

4545
uv_wavelengths = np.ones(shape=(4, 2))
46-
grid_radians = np.ones(shape=(1, 2))
46+
grid_radians = aa.grid.manual_2d([[[1.0, 1.0]]])
4747

4848
transformer = aa.transformer(
4949
uv_wavelengths=uv_wavelengths,
@@ -59,7 +59,7 @@ def test__real_visibilities__intensity_image_varies__simple_cases(self):
5959

6060
uv_wavelengths = np.array([[0.2, 1.0], [0.5, 1.1], [0.8, 1.2]])
6161

62-
grid_radians = np.array([[0.1, 0.2], [0.3, 0.4]])
62+
grid_radians = aa.grid.manual_2d([[[0.1, 0.2], [0.3, 0.4]]])
6363

6464
transformer = aa.transformer(
6565
uv_wavelengths=uv_wavelengths,
@@ -78,7 +78,7 @@ def test__real_visibilities__intensity_image_varies__simple_cases(self):
7878
def test__real_visibilities__preload_and_non_preload_give_same_answer(self):
7979

8080
uv_wavelengths = np.ones(shape=(4, 2))
81-
grid_radians = np.ones(shape=(1, 2))
81+
grid_radians = aa.grid.manual_2d([[[1.0, 1.0]]])
8282

8383
transformer_preload = aa.transformer(
8484
uv_wavelengths=uv_wavelengths,
@@ -103,7 +103,7 @@ def test__real_visibilities__preload_and_non_preload_give_same_answer(self):
103103
def test__imag_visibilities__intensity_image_all_ones__simple_cases(self):
104104

105105
uv_wavelengths = np.ones(shape=(4, 2))
106-
grid_radians = np.ones(shape=(1, 2))
106+
grid_radians = aa.grid.manual_2d([[[1.0, 1.0]]])
107107

108108
transformer = aa.transformer(
109109
uv_wavelengths=uv_wavelengths,
@@ -119,7 +119,7 @@ def test__imag_visibilities__intensity_image_all_ones__simple_cases(self):
119119

120120
uv_wavelengths = np.array([[0.2, 1.0], [0.5, 1.1], [0.8, 1.2]])
121121

122-
grid_radians = np.array([[0.1, 0.2], [0.3, 0.4]])
122+
grid_radians = aa.grid.manual_2d([[[0.1, 0.2], [0.3, 0.4]]])
123123

124124
transformer = aa.transformer(
125125
uv_wavelengths=uv_wavelengths,
@@ -138,7 +138,7 @@ def test__imag_visibilities__intensity_image_all_ones__simple_cases(self):
138138
def test__imag_visibilities__intensity_image_varies__simple_cases(self):
139139

140140
uv_wavelengths = np.ones(shape=(4, 2))
141-
grid_radians = np.ones(shape=(1, 2))
141+
grid_radians = aa.grid.manual_2d([[[1.0, 1.0]]])
142142

143143
transformer = aa.transformer(
144144
uv_wavelengths=uv_wavelengths,
@@ -154,7 +154,7 @@ def test__imag_visibilities__intensity_image_varies__simple_cases(self):
154154

155155
uv_wavelengths = np.array([[0.2, 1.0], [0.5, 1.1], [0.8, 1.2]])
156156

157-
grid_radians = np.array([[0.1, 0.2], [0.3, 0.4]])
157+
grid_radians = aa.grid.manual_2d([[[0.1, 0.2], [0.3, 0.4]]])
158158

159159
transformer = aa.transformer(
160160
uv_wavelengths=uv_wavelengths,
@@ -173,7 +173,7 @@ def test__imag_visibilities__intensity_image_varies__simple_cases(self):
173173
def test__imag_visibilities__preload_and_non_preload_give_same_answer(self):
174174

175175
uv_wavelengths = np.ones(shape=(4, 2))
176-
grid_radians = np.ones(shape=(1, 2))
176+
grid_radians = aa.grid.manual_2d([[[1.0, 1.0]]])
177177

178178
transformer_preload = aa.transformer(
179179
uv_wavelengths=uv_wavelengths,
@@ -199,7 +199,7 @@ def test__visiblities_from_image__same_as_individual_calculations_above(self):
199199

200200
uv_wavelengths = np.array([[0.2, 1.0], [0.5, 1.1], [0.8, 1.2]])
201201

202-
grid_radians = np.array([[0.1, 0.2], [0.3, 0.4]])
202+
grid_radians = aa.grid.manual_2d([[[0.1, 0.2], [0.3, 0.4]]])
203203

204204
transformer = aa.transformer(
205205
uv_wavelengths=uv_wavelengths,

0 commit comments

Comments
 (0)