Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert updates #109

Merged
merged 6 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading