-
Notifications
You must be signed in to change notification settings - Fork 14
Feature/jax in image dict #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -363,12 +363,12 @@ class OperateImageGalaxies(OperateImageList): | |
| """ | ||
|
|
||
| def galaxy_image_2d_dict_from( | ||
| self, grid: aa.Grid2D, operated_only: Optional[bool] = None | ||
| self, grid: aa.Grid2D, xp=np, operated_only: Optional[bool] = None | ||
| ) -> Dict[Galaxy, aa.Array2D]: | ||
| raise NotImplementedError | ||
|
|
||
| def galaxy_blurred_image_2d_dict_from( | ||
| self, grid, psf, blurring_grid | ||
| self, grid, psf, blurring_grid, xp=np | ||
| ) -> Dict[Galaxy, aa.Array2D]: | ||
| """ | ||
| Evaluate the light object's dictionary mapping galaixes to their corresponding 2D images and convolve each | ||
|
|
@@ -392,15 +392,15 @@ def galaxy_blurred_image_2d_dict_from( | |
| """ | ||
|
|
||
| galaxy_image_2d_not_operated_dict = self.galaxy_image_2d_dict_from( | ||
| grid=grid, operated_only=False | ||
| grid=grid, operated_only=False, xp=xp | ||
| ) | ||
|
|
||
| galaxy_blurring_image_2d_not_operated_dict = self.galaxy_image_2d_dict_from( | ||
| grid=blurring_grid, operated_only=False | ||
| grid=blurring_grid, operated_only=False, xp=xp | ||
|
Comment on lines
+395
to
+399
|
||
| ) | ||
|
|
||
| galaxy_image_2d_operated_dict = self.galaxy_image_2d_dict_from( | ||
| grid=grid, operated_only=True | ||
| grid=grid, operated_only=True, xp=xp | ||
| ) | ||
|
|
||
| galaxy_blurred_image_2d_dict = {} | ||
|
|
@@ -414,6 +414,7 @@ def galaxy_blurred_image_2d_dict_from( | |
| blurred_image_2d = psf.convolved_image_from( | ||
| image=image_2d_not_operated, | ||
| blurring_image=blurring_image_2d_not_operated, | ||
| xp=xp, | ||
| ) | ||
|
|
||
| image_2d_operated = galaxy_image_2d_operated_dict[galaxy_key] | ||
|
|
@@ -451,7 +452,7 @@ def galaxy_visibilities_dict_from( | |
| in the uv-plane. | ||
| """ | ||
|
|
||
| galaxy_image_2d_dict = self.galaxy_image_2d_dict_from(grid=grid) | ||
| galaxy_image_2d_dict = self.galaxy_image_2d_dict_from(grid=grid, xp=xp) | ||
|
||
|
|
||
| galaxy_visibilities_dict = {} | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type annotation
-> {Galaxy: np.ndarray}is a dict literal, not a typing annotation, and it doesn’t match the actual returned values (which areaa.Array2Dinstances fromimage_2d_list_from). Replace it with an appropriate typing type (e.g.Dict[Galaxy, aa.Array2D]) to avoid confusing/incorrect type information.