-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[ENH] Vendor fracdiff library #6777
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Thanks a lot!
Great, 1:1 vendor distribution minus the parts dependent on statsmodels
, as discussed. I will comment on the latter in the original issue, i.e., how I would design it. My preference would be to design a full replacement in sktime
instead of keeping the equivalent class inside the vendored package.
What I would say, we merge this as-is, only minor requests:
- the
fracdiff.__init__.py
should include a license and contributions preamble, seepykalman
- could you kindly decorate all the test clsases with
pytest.skipif
depending on whether anything in the vendor lib has changed? Similar to, e.g.,pykalman.tests.test_standard
- I see the
sklearn
estimators' tests but am surprised to not see acheck_estimator
conformance test. More specifically, I would add aparametrize_with_checks
decorated test to run the full suite ofsklearn
API conformance tests: https://scikit-learn.org/stable/modules/generated/sklearn.utils.estimator_checks.parametrize_with_checks.html#sklearn.utils.estimator_checks.parametrize_with_checks- I would expect this to simply run, but if it fails, let's add it and xfail, and report as an issue that we have API non-conformance
- if it is too fiddly, we can also do this separately, then we should record this as an open issue that such tests need to be added
- a minor typo in the README, see above
Ok, I think this addresses all the pr comments. The preamble existed, I just put it into the wrong init (whoops). I also left an empty directory in tests ( I'll leave the non-comformance failures here to copy into the issue you're asking for if this is allowed to merge:
|
sktime/libs/fracdiff/__init__.py
Outdated
Unofficial fork of the ``fracdiff`` package, maintained in ``sktime``. | ||
|
||
sktime migration: 2024, July | ||
Version 0.9.1 release: 2023, Feb 4 (DinoBektesevic) |
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 is not correct, is it? It should be the last releast on pypi and account name.
Migration was done by DinoBektesevic
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.
Uh oh, I cloned the current tagged release on GitHub: fracdiff/fracdiff@93ce110 which is marked as 0.9.1 - is this a problem?
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.
Great, thanks! Some minor things:
- code formatting is failing, could you run the pre-commits? https://www.sktime.net/en/latest/developer_guide/coding_standards.html
- the
sklearn
estimator does not seem to pass thesklearn
conformance tests. Though it seems like it could be easy to fix - by addingcheck_array
at the start offit
.
Hey, sorry it took me a while for this simple request. My week suddenly got really interesting. I added the I'm not sure what that does so I didn't fix it - better to say I didn't understand what the expected returns of the fracdiff are. There's less errors than before though!
|
Hmm, strange, on my end all the tests get skipped by pre-commit let me try to see if I run it manually with |
a4a3f98
to
6f6e7c9
Compare
Initial commit contians all of the code, as an attempt to have the tests pass with absolutely mininmal changes to the base library. This commit is intended as a reference for posterity. Future commits have the commented out code deleted.
Ok, running the pre-commit manually pointed out to some files in
Should be good to go this time. |
6f6e7c9
to
650693b
Compare
Great, thx! Re sklearn failures, I will have a look. They seem to be genuine and probably have been part of the |
Reference Issues/PRs
Resolves #6700 core issue of vendoring fracdiff package.
What does this implement/fix? Explain your changes.
The fracdiff package has been archived which reduced the usability of sktime for some users.
This PR is the initial step in vendoring the library as a
libs
component of sktime.The intention at the time of initial PR is to have the tests pass with minimal changes to the original library, however, some changes were necessary:
fracdiff
tensor interface was removedFracDiffStat
class was removed (depended onStatTester
class)StatTester
class was removed, depended onstatsmodels
FracDiffStat
seems useful, butStatTester
, I was told, should be re-implemented (or changed inFracDiffStat
to some other tester of "stationarity" (code defaulted to "ADF") that already exists in sktime. I'm just not knowledgeable enough about what's happening here, but I can work it out if there's an example somewhere that shows me how to use that test and try to rewrite. YMMV.StatTester
andFracDiffStat
were then also removedFracdiff
class is imported to top-level from sklearn because the tensor wrappers were removedfdiff
andfdiff_coeff
functions are also now imported to top-level to avoid the a triplefdiff.fdiff.fdiff
Does your contribution introduce a new dependency? If yes, which one?
Not as is, potentially
tesorflow
orstatsmodel
, depending on further advice I get.What should a reviewer concentrate their feedback on?
[edit: I just saw some of the discussion in the Issue relating to the first two points, whoops]
FracDiffStat
useful, should it be added back in or is this mute because a different tester exists that is already usable as-is?statsmodel
then back in?FracDiff
should be wrapped in aDifferencer
(or some such, or was it a "transformation") but I spent an hour driving home after the hack and now I can't remember what was the base class I was pointed to exactly. If someone can remind me of the class I should wrap the SKLearnFracDiff
in that'd be swell...Did you add any tests for the change?
Tests are all as in original library, minus the removed ones.
PR checklist
For all contributions
How to: add yourself to the all-contributors file in the
sktime
root directory (not theCONTRIBUTORS.md
). Common badges:code
- fixing a bug, or adding code logic.doc
- writing or improving documentation or docstrings.bug
- reporting or diagnosing a bug (get this pluscode
if you also fixed the bug in the PR).maintenance
- CI, test framework, release.See here for full badge reference