Skip to content

Commit 10c5c3a

Browse files
Jammy2211Jammy2211
authored andcommitted
quirks removed
1 parent 6432787 commit 10c5c3a

4 files changed

Lines changed: 17 additions & 34 deletions

File tree

autogalaxy/ellipse/model/plotter_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def should_plot(name):
4646
dataset_plotter.subplot_dataset()
4747

4848
image_list = [
49-
dataset.data.native_for_fits,
50-
dataset.noise_map.native_for_fits,
49+
dataset.data.native,
50+
dataset.noise_map.native,
5151
]
5252

5353
hdu_list = hdu_list_for_output_from(

autogalaxy/galaxy/galaxies.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarr
172172
grid
173173
The 2D (y, x) coordinates where values of the deflections are evaluated.
174174
"""
175-
if self:
176-
return sum(map(lambda g: g.deflections_yx_2d_from(grid=grid), self))
177-
return np.zeros(shape=(grid.shape[0], 2))
175+
return sum(map(lambda g: g.deflections_yx_2d_from(grid=grid), self))
178176

179177
@aa.grid_dec.to_grid
180178
def traced_grid_2d_from(self, grid: aa.type.Grid2DLike) -> aa.type.Grid2DLike:
@@ -205,9 +203,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray:
205203
grid
206204
The 2D (y, x) coordinates where values of the convergence are evaluated.
207205
"""
208-
if self:
209-
return sum(map(lambda g: g.convergence_2d_from(grid=grid), self))
210-
return np.zeros((grid.shape[0],))
206+
return sum(map(lambda g: g.convergence_2d_from(grid=grid), self))
211207

212208
@aa.grid_dec.to_array
213209
def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray:
@@ -231,9 +227,7 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray:
231227
grid
232228
The 2D (y, x) coordinates where values of the potential are evaluated.
233229
"""
234-
if self:
235-
return sum(map(lambda g: g.potential_2d_from(grid=grid), self))
236-
return np.zeros((grid.shape[0],))
230+
return sum(map(lambda g: g.potential_2d_from(grid=grid), self))
237231

238232
def has(self, cls: Union[Type, Tuple[Type]]) -> bool:
239233
"""

autogalaxy/galaxy/galaxy.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,7 @@ def image_2d_from(
229229
> 0
230230
):
231231
return sum(self.image_2d_list_from(grid=grid, operated_only=operated_only))
232-
233-
return np.zeros((grid.shape[0],))
234-
235-
# return jnp.zeros((grid.shape[0],))
232+
return jnp.zeros((grid.shape[0],))
236233

237234
@aa.grid_dec.to_projected
238235
def image_1d_from(self, grid: aa.type.Grid2DLike) -> np.ndarray:
@@ -264,9 +261,8 @@ def image_1d_from(self, grid: aa.type.Grid2DLike) -> np.ndarray:
264261
image_1d_list.append(light_profile.image_1d_from(grid=grid_radial))
265262

266263
return sum(image_1d_list)
267-
return np.zeros((grid.shape[0],))
268264

269-
# return jnp.zeros((grid.shape[0],))
265+
return jnp.zeros((grid.shape[0],))
270266

271267
@aa.grid_dec.to_vector_yx
272268
def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray:
@@ -294,9 +290,8 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarr
294290
self.cls_list_from(cls=MassProfile),
295291
)
296292
)
297-
return np.zeros((grid.shape[0], 2))
298293

299-
# return jnp.zeros((grid.shape[0], 2))
294+
return jnp.zeros((grid.shape[0], 2))
300295

301296
@aa.grid_dec.to_array
302297
def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray:
@@ -324,9 +319,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray:
324319
)
325320
)
326321

327-
return np.zeros((grid.shape[0],))
328-
329-
# return jnp.zeros((grid.shape[0],))
322+
return jnp.zeros((grid.shape[0],))
330323

331324
@aa.grid_dec.to_grid
332325
def traced_grid_2d_from(self, grid: aa.type.Grid2DLike) -> aa.type.Grid2DLike:
@@ -376,9 +369,7 @@ def convergence_1d_from(self, grid: aa.type.Grid1D2DLike) -> np.ndarray:
376369

377370
return sum(convergence_1d_list)
378371

379-
return np.zeros((grid.shape[0],))
380-
381-
# return jnp.zeros((grid.shape[0],))
372+
return jnp.zeros((grid.shape[0],))
382373

383374
@aa.grid_dec.to_array
384375
def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray:
@@ -405,9 +396,7 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray:
405396
self.cls_list_from(cls=MassProfile),
406397
)
407398
)
408-
return np.zeros((grid.shape[0],))
409-
410-
# return jnp.zeros((grid.shape[0],))
399+
return jnp.zeros((grid.shape[0],))
411400

412401
@aa.grid_dec.to_projected
413402
def potential_1d_from(self, grid: aa.type.Grid2DLike) -> np.ndarray:
@@ -439,9 +428,8 @@ def potential_1d_from(self, grid: aa.type.Grid2DLike) -> np.ndarray:
439428
)
440429

441430
return sum(potential_1d_list)
442-
return np.zeros((grid.shape[0],))
443431

444-
# return jnp.zeros((grid.shape[0],))
432+
return jnp.zeros((grid.shape[0],))
445433

446434
@property
447435
def half_light_radius(self):

autogalaxy/profiles/basis.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import jax.numpy as jnp
12
import numpy as np
23
from typing import Dict, List, Optional, Union
34

@@ -128,7 +129,7 @@ def image_2d_list_from(
128129
(
129130
light_profile.image_2d_from(grid=grid, operated_only=operated_only)
130131
if not isinstance(light_profile, lp_linear.LightProfileLinear)
131-
else np.zeros((grid.shape[0],))
132+
else jnp.zeros((grid.shape[0],))
132133
)
133134
for light_profile in self.light_profile_list
134135
]
@@ -154,7 +155,7 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> aa.Array2D:
154155
return sum(
155156
[mass.convergence_2d_from(grid=grid) for mass in self.profile_list]
156157
)
157-
return np.zeros((grid.shape[0],))
158+
return jnp.zeros((grid.shape[0],))
158159

159160
def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> aa.Array2D:
160161
"""
@@ -177,7 +178,7 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> aa.Array2D:
177178
return sum(
178179
[mass.potential_2d_from(grid=grid) for mass in self.profile_list]
179180
)
180-
return np.zeros((grid.shape[0],))
181+
return jnp.zeros((grid.shape[0],))
181182

182183
def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> aa.Array2D:
183184
"""
@@ -200,7 +201,7 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs) -> aa.Array
200201
return sum(
201202
[mass.deflections_yx_2d_from(grid=grid) for mass in self.profile_list]
202203
)
203-
return np.zeros((grid.shape[0], 2))
204+
return jnp.zeros((grid.shape[0], 2))
204205

205206
def lp_instance_from(self, linear_light_profile_intensity_dict: Dict):
206207
light_profile_list = []

0 commit comments

Comments
 (0)