Skip to content

Commit

Permalink
moving and correcting checks for finite source methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoleski committed Oct 5, 2023
1 parent 2d8fdc1 commit 5bea3a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions source/MulensModel/magnificationcurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,14 @@ def get_magnification(self):
Vector of magnifications.
"""
if self.parameters.rho is not None:
self._check_for_finite_source_method()

if self.parameters.n_lenses == 1:
magnification = self.get_point_lens_magnification()
elif self.parameters.n_lenses == 2:
magnification = self.get_binary_lens_magnification()
else:
raise NotImplementedError(
"magnification for more than 2 lenses not handled yet")

self._magnification = magnification
return self._magnification

Expand Down Expand Up @@ -251,6 +249,9 @@ def get_point_lens_magnification(self):
Vector of magnifications.
"""
if self.parameters.is_finite_source():
self._check_for_finite_source_method()

if self.parameters.n_lenses != 1:
raise ValueError(
"You're trying to calculate single lens magnification, but "
Expand Down Expand Up @@ -384,6 +385,9 @@ def get_binary_lens_magnification(self):
Vector of magnifications.
"""
if self.parameters.is_finite_source():
self._check_for_finite_source_method()

if self.parameters.n_lenses != 2:
raise ValueError(
"You're trying to calculate binary lens magnification, but "
Expand Down
2 changes: 1 addition & 1 deletion source/MulensModel/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.18.4"
__version__ = "2.18.5"

0 comments on commit 5bea3a9

Please sign in to comment.