lina-usc / pylossless

🧠 EEG Processing pipeline that annotates continuous data
https://pylossless.readthedocs.io/en/latest/
MIT License
25 stars 10 forks source link

Rejection policy refactor #145

Closed scott-huberty closed 1 year ago

scott-huberty commented 1 year ago

closes #115 closes / supercedes #138

I've been working through #138 (which was a great start!) which led to some refactoring. Instead of pushing the changes to that branch (and over writing some of the initial work), I copied the branch and pushed it here so that we can discuss/compare if necesary.

I had some nitpicks that I've addressed here:

Config class and RejectionPolicy

tests and tutorials

I built out the unit tests to be more comprehensive (there was a typo in #138 that wasn't being caught by the tests), and I've added a tutorial on running the pipeline and applying the Rejection Policy

I committed my changes directly on my local #138 branch then duplicated it into this branch for this PR. So if there are concerns about contributing authorship etc, we can push the changes onto that branch and merge there.

scott-huberty commented 1 year ago

Note that in https://github.com/mne-tools/mne-icalabel/pull/130 , ICALABEL changed the name of their constant dict from ICLABEL_LABELS_TO_MNE to ICA_LABELS_TO_MNE, which is part of the latest stable released just yesterday (0.5), thus breaking our tests today.

Because this is still a very small project I think it's okay to pin to mne-icalabel 0.5 or greater, and I added an mne.utils.check_version to our package so that in the event that someone on our team doesnt have at least 0.5, they will get an informative error.

codecov[bot] commented 1 year ago

Codecov Report

Merging #145 (f66e251) into main (dbb775e) will increase coverage by 1.18%. The diff coverage is 90.10%.

@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   71.60%   72.79%   +1.18%     
==========================================
  Files          18       21       +3     
  Lines        1074     1154      +80     
==========================================
+ Hits          769      840      +71     
- Misses        305      314       +9     
Files Coverage Δ
pylossless/__init__.py 100.00% <100.00%> (ø)
pylossless/config/__init__.py 100.00% <100.00%> (ø)
pylossless/config/config.py 91.30% <100.00%> (ø)
pylossless/conftest.py 100.00% <100.00%> (ø)
pylossless/datasets/__init__.py 100.00% <100.00%> (ø)
pylossless/dash/__init__.py 83.33% <80.00%> (-16.67%) :arrow_down:
pylossless/pipeline.py 75.56% <96.00%> (+1.22%) :arrow_up:
pylossless/datasets/datasets.py 92.30% <92.30%> (ø)
pylossless/config/rejection.py 72.22% <72.22%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more