Prep for 0.7.0 (major update to dependencies, tests, documentation and build infra)#225
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #225 +/- ##
==========================================
+ Coverage 77.45% 85.36% +7.90%
==========================================
Files 14 14
Lines 2684 2705 +21
Branches 326 330 +4
==========================================
+ Hits 2079 2309 +230
+ Misses 568 342 -226
- Partials 37 54 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@raphaelvallat this is great, thanks for all the updates and cleaning up the evaluation module. I'm just catching up on all the new changes and the last things I was hoping to add in #166. Whenever you're ready, if you think it's appopriate I can give this a quick review. I wouldn't get into much detail on anything other than the evaluation module. I'd just like to give that a quick test run locally. |
|
@remrama — I'm mostly done now, please feel free to review the changes in the evaluation module! Out of the 4 remaining tasks in #166, this PR implements:
I don't think we need to include the BA plots for this release, unless you think it's critical. |
|
This PR is becoming too big so I'll merge it once you had a chance to review, but we can definitely take a few more days or weeks to add more functionalities/documentation before I do the formal 0.7.0 release 👍 |
|
Proposal: Remaining tasks/issues after merging this PR before formal 0.7.0 release
Stretch:
|
remrama
left a comment
There was a problem hiding this comment.
This is great @raphaelvallat! Fantastic push to get things up to date and modernized. The evaluation module looks solid, thanks again for cleaning it up. I assume the testing is appropriate and it's clear that it's passing, so I'm not worried about that. Only thing I was gonna do is verify that the values in docstring examples are accurate (since those are manually input). Do we have anything in the CI workflows or doc build that handles that verification? If not, I'll run locally and verify.
Not in the CI but I asked Claude to run and fix all the doctest for the evaluation and hypnogram modules |
Cool, ya I saw some values (in docstrings) were updated so I figured there was some kind of check. That's cool for now. I'll double-check next time I submit anything related to that module, but for this let's leave it as-is without another check since it's not a functional piece of the module anyways. Good to go 🚀 |
@remrama — with major help from Claude, I'm preparing a major upgrade of YASA. I don't expect you to review all the changes in this PR but just an FYI. A (non-exhaustive) list of all the changes implemented in this PR is provided below — see also the
changelog.rstfileDependencies
compare_detection— replaced np.fill_diagonal(coinc_mat.values, ...)withnp.diag_indices_from + coinc_mat.iloc[idx].Hypnogram.consolidate_stages.Hypnogram.__init__when pandas returns an ArrowStringArray (new default string backend in pandas 3.0).pd.concat.Series.sum(1)→Series.sum(axis=1)in Hypnogram and the test suite.New features
new Hypnogram.from_integersclassmethod: New convenience constructor to create a Hypnogram directly from a legacy integer-encoded array (e.g. loaded from a plain-text file vianp.loadtxt). Replaces the oldtwo-step hypno_int_to_str + Hypnogram(...) pattern and accepts an optional custom mapping for non-standard integer encodings.
transition_matrixacceptsHypnogram:yasa.transition_matrixnow accepts aHypnograminstance in addition to integer arrays. When passed aHypnogram, output DataFrames use string stage labels ("WAKE", "N1",etc.) instead of integers.
Unit tests
EpochByEpochAgreementandSleepStatsAgreementcovering construction, input validation, all public methods--covfrompytest addoptsso individual test files can be run without triggering full coverage collectionBugfix
Documentation
HypnogramAPIRemaining tasks before merge