From 2a813b06a3f5a739bd4179644334232285f867f7 Mon Sep 17 00:00:00 2001 From: radek_poleski <radek.poleski@gmail.com> Date: Fri, 17 Jan 2025 13:33:46 +0100 Subject: [PATCH] test on binary mag. for s of int type --- source/MulensModel/tests/test_BinaryLens.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/MulensModel/tests/test_BinaryLens.py b/source/MulensModel/tests/test_BinaryLens.py index 086c310e..2d528bf7 100644 --- a/source/MulensModel/tests/test_BinaryLens.py +++ b/source/MulensModel/tests/test_BinaryLens.py @@ -111,6 +111,24 @@ def test_gamma_10_quad(self): self._test_gamma_quad(1.0, self.reference_10[1]) +def test_int_input(): + """ + Check binary lens calculation with s of int type. + """ + arg_1 = [0.001, 0.001] + arg_2 = {'s': 1., 'q': 0.1} + trajectory_1 = make_trajectory(arg_1, arg_2) + lens_1 = mm.BinaryLensPointSourceMagnification(trajectory=trajectory_1) + result_1 = lens_1.get_magnification() + + arg_2['s'] = int(arg_2['s']) + trajectory_2 = make_trajectory(arg_1, arg_2) + lens_2 = mm.BinaryLensPointSourceMagnification(trajectory=trajectory_2) + result_2 = lens_2.get_magnification() + + assert result_1 == result_2 + + def test_BinaryLensVBBLMagnification_1(): """ check basic magnification calculation using VBBL