[ENH] Improve skbase.utils#126
Conversation
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 #126 +/- ##
==========================================
+ Coverage 81.90% 82.35% +0.44%
==========================================
Files 30 31 +1
Lines 2249 2278 +29
==========================================
+ Hits 1842 1876 +34
+ Misses 407 402 -5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
@fkiraly do you want to take a look at this PR. Just cleans up some of the utility functionality. |
fkiraly
left a comment
There was a problem hiding this comment.
Apologies, I thought I had posted here already.
I am very happy with the improved docstrings, tests, etc.
However, I think at least some of the functions (e.g., flatten, unflatten) should remain public - in sktime, these are used in some concrete ensembles where they are useful to deal with index selection.
I do not have a too strong feeling about it though and would not block the PR.
However, leaving them private would mean that sktime has to copy-paste and maintain its own utilities around nested iterables, which seems wrong to me.
|
@fkiraly I am definitely up for leaving some functions part of the public API. It's an easy update on this PR. Which do you think we should specifically make part of the public API? |
|
@fkiraly let me know what you think in terms of the functions in utils you want public. I can switch the naming conventions and add them to the API really quick. |
I won't complain :-)
|
fkiraly
left a comment
There was a problem hiding this comment.
Looks good (no strong opinion about flatten/unflatten, I would prefer them public)
Question, before we merge: there is an intersection with PR #130, the file _iter. Is this intended? If not, should be fixed; if so, is there a sequence this is intended to be merged?
|
@fkiraly this is failing because of fix needed for |
fkiraly
left a comment
There was a problem hiding this comment.
Happy with this - the public/private was not a blocker, I just wanted to flag the intersection. Given that you have a plan on how to handle the intersection/dependency here, all is good from my side.
Reference Issues/PRs
Completes the portion of #49 and #19 for the
skbase.utilssubmodule. Note that I've included docstring examples for the functions even if they aren't public because I think it is helpful for developers to be able to get a quick glimpse of what the function does.Also updates names of functions to be non-public (I'm guessing we don't want them in user API) and make minor tweaks to make functions more robust or generalizable (as discovered during test creation).
What does this implement/fix? Explain your changes.
The changes reflect:
skbase.utils(functions are tested further in tests of their downstream uses)skbase.utilsfunctionality (I believe these all now comply withnumpydocstandard and have examples)Does your contribution introduce a new dependency? If yes, which one?
No new dependencies.
What should the reviewer focus their review on
I believe I added reasonable tests of the basic functionality of these utils (they are implicitly further tested in their downstream uses). So the key thing is whether you agree with the renaming to make the functionality non-public (i.e., not part of public API). Let me know if any of the functions in
skbase.utils._iter.pyorskbase.utils._nested_iter.pyseem like something we want to include in the public API. Happy to switch the naming convention and add them to the API Reference.PR checklist
For all contributions
the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions