[ENH] Introduce Serialization Support#154
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
fkiraly
left a comment
There was a problem hiding this comment.
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.
loadas a standalone function,saveasBaseObjectmethod) fromsktimeDoes your contribution introduce a new dependency? If yes, which one?
None
What should a reviewer concentrate their feedback on?
banditcomplains 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