-
Notifications
You must be signed in to change notification settings - Fork 16
Begin smoothing utility integration into JHU. #177
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
Conversation
d9b35db
to
7afba80
Compare
This should be good to go now. Needed fixes from #478, so this should be merged after that. |
1d720ea
to
d329ee2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linting problems, but code otherwise looks fine. Is this expected to noticeably change the output of the indicator?
@@ -10,11 +11,26 @@ | |||
|
|||
|
|||
class TestSmoothers: | |||
def test_bad_inputs(self): | |||
with pytest.raises(ValueError): | |||
Smoother(smoother_name="hamburger") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am but carrying on a tradition passed down to me by my advisor and his advisor before him for generations 🤣
"""Predict a single value using the savgol method. | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should fail linting -- we've got the utils package disabled in CI so you'll need to run it manually for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just opened #494, if that gets merged first then should probably merge it into this branch and let it run all checks.
Slight possibility when enabling these checks that an existing PR gets merged without the checks merged in and you end up with a failing main, but should be easy to resolve and won't happen once new PRs pull from the new main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I now got these checks running automatically in my IDE, (thanks @chinandrew 🥇), so that will make things smoother.
smoothed_signal = smoother.smooth(signal) | ||
assert np.allclose(smoothed_signal, np.array([np.nan, 1, 1]), equal_nan=True) | ||
|
||
# Test a range of cases where the signal size following a sequence of nans is returned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch
jhu/tests/test_smooth.py
Outdated
dates = [str(x) for x in range(20200303, 20200310)] | ||
dates = [str(x) for x in range(20200304, 20200311)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it was from this issue. I wasn't sure which date was the latest, I'll switch it back.
ef3faeb
to
f8af034
Compare
@krivard no value changes expected from the indicator. |
* remove local smoothing module * update and lint run.py * a few linter / formatting changes in jhu tests * a few linter / formatting changes in smoother util
f8af034
to
dfee042
Compare
Starting this work here. Added a local-weighted regression option to the Savitzky-Golay smoother to allow more fine-grained control (needs a little more testing). Continuing to update the documentation IPython notebook.