From 15d38bc32c7ec4edbbecd0b7019f464dc83fa1a1 Mon Sep 17 00:00:00 2001 From: Joshua Nielsen Date: Thu, 22 Feb 2024 22:39:19 -0700 Subject: [PATCH] Revert updates (#109) --- lppls/lppls.py | 9 ++++----- lppls/tests/test_lppls.py | 2 +- setup.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lppls/lppls.py b/lppls/lppls.py index e62b00e..50545b5 100644 --- a/lppls/lppls.py +++ b/lppls/lppls.py @@ -485,7 +485,7 @@ def compute_nested_fits( i_idx += 1 for j in range(0, window_delta, inner_increment): obs_shrinking_slice = obs[:, j:window_size] - tc, m, w, a, b, c, c1, c2, O, D = self.fit( + tc, m, w, a, b, c, _, _, _, _ = self.fit( max_searches, obs=obs_shrinking_slice ) res[i_idx - 1].append([]) @@ -581,8 +581,8 @@ def _func_compute_nested_fits(self, args): # "t2_d": self.ordinal_to_date(nested_t2), "t1": nested_t1, "t2": nested_t2, - # "O": O, - # "D": D, + "O": O, + "D": D, } ) @@ -614,8 +614,7 @@ def _is_D_in_range(self, m, w, b, c, D_min): return False if m <= 0 or w <= 0 else abs((m * b) / (w * c)) > D_min def get_oscillations(self, w, tc, t1, t2): - dt = np.abs(tc - t2) + 1e-8 - return (w / (2.0 * np.pi)) * np.log((tc - t1) / dt) + return (w / (2.0 * np.pi)) * np.log((tc - t1) / (tc - t2)) def get_damping(self, m, w, b, c): return (m * np.abs(b)) / (w * np.abs(c)) diff --git a/lppls/tests/test_lppls.py b/lppls/tests/test_lppls.py index a27cadd..99299b1 100644 --- a/lppls/tests/test_lppls.py +++ b/lppls/tests/test_lppls.py @@ -94,7 +94,7 @@ def test_mp_compute_nested_fits(observations, lppls_model): assert res[0]['t1'] == 0.0 assert res[0]['t2'] == 79.0 assert res[4]['t1'] == 20.0 - expected_keys = {'tc_d', 'tc', 'm', 'w', 'a', 'b', 'c', 'c1', 'c2', 't1_d', 't2_d', 't1', 't2', 'O', 'D'} + expected_keys = {'tc', 'm', 'w', 'a', 'b', 'c', 'c1', 'c2', 't1', 't2', 'O', 'D'} assert len(res[0]['res']) == 30 assert set(res[0]['res'][0]).issubset(expected_keys) diff --git a/setup.py b/setup.py index 79114fe..54f6c0d 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ long_description = fh.read() setuptools.setup(name='lppls', - version='0.6.16', + version='0.6.18', description='A Python module for fitting the LPPLS model to data.', packages=['lppls'], author='Josh Nielsen',