Skip to content

Commit

Permalink
Radek suggestions for q > 1, shorter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rapoliveira committed May 10, 2024
1 parent 9160298 commit 276ac18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions source/MulensModel/modelparameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def _check_valid_parameter_values(self, parameters):
for name in ['q']:
if name in parameters.keys():
if parameters[name] <= 0.:
msg = "Parameter {:} has to be in (0, 1) range, not {:}"
msg = "Parameter {:} has to be larger than 0, not {:}"
raise ValueError(msg.format(name, parameters[name]))

for name in ['xi_eccentricity']:
Expand Down Expand Up @@ -1234,8 +1234,8 @@ def q(self):

@q.setter
def q(self, new_q):
if new_q < 0.:
raise ValueError('mass ratio q has to be between 0 and 1')
if new_q <= 0.:
raise ValueError('mass ratio q has to be larger than 0')
self.parameters['q'] = new_q
self._update_sources('q', new_q)

Expand Down
4 changes: 2 additions & 2 deletions source/MulensModel/tests/test_ModelParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_q_gt_1_is_good():
planet.set_magnification_methods(list_of_methods)
planet_2.set_magnification_methods(list_of_methods)
planet_3.set_magnification_methods(list_of_methods)
t_range = np.arange(3580., 3600., 0.1)
t_range = [3580, 3589, 3590, 3592, 3593, 3595]
magnifications_1 = planet.get_magnification(time=t_range)
magnifications_2 = planet_2.get_magnification(time=t_range)
magnifications_3 = planet_3.get_magnification(time=t_range)
Expand All @@ -200,7 +200,7 @@ def test_q_gt_1_is_smooth():

planet.set_magnification_methods([3590., 'VBBL', 3595.])
planet_2.set_magnification_methods([3590., 'VBBL', 3595.])
t_range = np.arange(3580., 3600., 0.1)
t_range = [3571, 3590.5, 3591, 3592, 3593.4, 3594.5]
magnifications_1 = planet.get_magnification(time=t_range)
magnifications_2 = planet_2.get_magnification(time=t_range)

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.23.0"
__version__ = "2.23.1"

0 comments on commit 276ac18

Please sign in to comment.