Skip to content

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

Merged
merged 1 commit into from
Nov 12, 2020
Merged

Conversation

dshemetov
Copy link
Contributor

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.

@dshemetov
Copy link
Contributor Author

This should be good to go now. Needed fixes from #478, so this should be merged after that.

@dshemetov dshemetov force-pushed the dev-smoothing-jhu branch 3 times, most recently from 1d720ea to d329ee2 Compare November 11, 2020 00:12
Copy link
Contributor

@krivard krivard left a 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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

Comment on lines 13 to 10
dates = [str(x) for x in range(20200303, 20200310)]
dates = [str(x) for x in range(20200304, 20200311)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this about?

Copy link
Contributor Author

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.

@dshemetov
Copy link
Contributor Author

@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
@krivard krivard merged commit e3c2784 into main Nov 12, 2020
@krivard krivard deleted the dev-smoothing-jhu branch February 9, 2021 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor jhu to use smoothing util
3 participants