Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 13, 2024
1 parent 9fb30cc commit 3e0d4e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions lenstronomy/Data/psf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def __init__(
)
# store the initial input PSF and supersampling factor
self._kernel_point_source_init = kernel_point_source
self._point_source_supersampling_factor_init = point_source_supersampling_factor
self._point_source_supersampling_factor_init = (
point_source_supersampling_factor
)
kernel_point_source_ = copy.deepcopy(kernel_point_source)
if kernel_point_source_normalisation is True:
kernel_point_source_ /= np.sum(kernel_point_source)
Expand Down Expand Up @@ -167,7 +169,9 @@ def kernel_point_source_supersampled(self, supersampling_factor, updata_cache=Tr
):
kernel_point_source_supersampled = self._kernel_point_source_supersampled
return kernel_point_source_supersampled
if hasattr(self, "._kernel_point_source_init") and hasattr(self, "._point_source_supersampling_factor_init"):
if hasattr(self, "._kernel_point_source_init") and hasattr(
self, "._point_source_supersampling_factor_init"
):
if self._point_source_supersampling_factor_init == supersampling_factor:
kernel_point_source_supersampled = self._kernel_point_source_init
return kernel_point_source_supersampled
Expand Down Expand Up @@ -221,9 +225,7 @@ def kernel_point_source_supersampled(self, supersampling_factor, updata_cache=Tr
else:
raise ValueError("psf_type %s not valid!" % self.psf_type)
if updata_cache is True:
self._kernel_point_source_supersampled = (
kernel_point_source_supersampled
)
self._kernel_point_source_supersampled = kernel_point_source_supersampled
self._point_source_supersampling_factor = supersampling_factor
return kernel_point_source_supersampled

Expand Down Expand Up @@ -275,4 +277,3 @@ def point_source_supersampling_factor(self):
return self._point_source_supersampling_factor_init
else:
return 1

3 changes: 2 additions & 1 deletion lenstronomy/PointSource/point_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def __init__(
self._point_source_list.append(
PointSourceCached(
SourcePositions(
lens_model, fixed_magnification=fixed_magnification_list[i],
lens_model,
fixed_magnification=fixed_magnification_list[i],
redshift=redshift_list[i],
),
save_cache=save_cache,
Expand Down

0 comments on commit 3e0d4e5

Please sign in to comment.