Skip to content

Commit

Permalink
Revert updates (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshwani authored Feb 23, 2024
1 parent 7c8c9d5 commit 15d38bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions lppls/lppls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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([])
Expand Down Expand Up @@ -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,
}
)

Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion lppls/tests/test_lppls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 15d38bc

Please sign in to comment.