-
Notifications
You must be signed in to change notification settings - Fork 12
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] Introduce Serialization Support #154
base: main
Are you sure you want to change the base?
Conversation
skbase/base/_base.py
Outdated
path = Path(path) if isinstance(path, str) else path | ||
path.mkdir() | ||
|
||
pickle.dump(type(self), open(path / "_metadata", "wb")) |
Check warning
Code scanning / CodeQL
File is not always closed
skbase/base/_base.py
Outdated
path.mkdir() | ||
|
||
pickle.dump(type(self), open(path / "_metadata", "wb")) | ||
pickle.dump(self, open(path / "_obj", "wb")) |
Check warning
Code scanning / CodeQL
File is not always closed
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.
Looks great!
Before I go into detail, I wanted to say that the tests are failing because skbase
uses itself as a test case for the crawling utilities, and requires you to enter new files, modules, classes, etc, in tests.conftest
(the lists).
Personally, I think this is very tedious for a contributor and wasn't a great design decision, so mid-term we need to get away from that. For now, I'd recommend you just add to the lists.
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #154 +/- ##
==========================================
- Coverage 82.68% 81.31% -1.37%
==========================================
Files 32 33 +1
Lines 2327 2376 +49
==========================================
+ Hits 1924 1932 +8
- Misses 403 444 +41
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
let me know when this is ready |
Part of #145 - Introduces serialization functionality.
Currently, this is a direct port from the functionality we have in
sktime
. I'll iteratively improve the code as per requirements and inputs.What does this implement/fix? Explain your changes.
load
as a standalone function,save
asBaseObject
method) fromsktime
Does your contribution introduce a new dependency? If yes, which one?
None
What should a reviewer concentrate their feedback on?
bandit
complains about the usage of pickle. I've excluded two tests (import and load) and will add a warning inload
's docstring regarding it. We should try to find safer alternatives to replace it in the future.Any other comments?
PR checklist
For all contributions
the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions