phys2bids
phys2bids copied to clipboard
NF/ADD CED spike2 file IO
Addresses #405.
The current implementation uses the official API, sonpy, from CED. sonpy is closed sourced.
In order to support sonpy, the minimal python version should be 3.7. Hence I will mark this as part of the major release.
The scanner volume trigger in the test file was stored as a "marker" channel. The sonpy API returns time points of markers, rather than a timeseries. The module I wrote has been tested locally. I cannot run the full test due to bandwidth and data limit. Will check if this breaks other tests.
Proposed Changes
- Add
phys2bids.io.load_smr
Change Type
- [ ]
bugfix(+0.0.1) - [x]
minor(+0.1.0) - [x]
major(+1.0.0) - [ ]
refactoring(no version update) - [ ]
test(no version update) - [ ]
infrastructure(no version update) - [ ]
documentation(no version update) - [ ]
other
Checklist before review
- [x] I added everything I wanted to add to this PR.
- [x] [Code or tests only] I wrote/updated the necessary docstrings.
- [x] [Code or tests only] I ran and passed tests locally.
- [ ] [Documentation only] I built the docs locally.
- [x] My contribution is harmonious with the rest of the code: I'm not introducing repetitions.
- [x] My code respects the adopted style, especially linting conventions.
- [x] The title of this PR is explanatory on its own, enough to be understood as part of a changelog.
- [ ] I added or indicated the right labels.
- [ ] I added information regarding the timeline of completion for this PR.
- [ ] Please, comment on my PR while it's a draft and give me feedback on the development!
~Looks like conda doesn't support the latest version of sonpy - I am not familiar with Cirrus CI, if anyone can look into how to get pip to install certain libraries, that would be grand.~
Found the reason. How sonpy uses release version number is unorthodox. It is an easy fix.
Codecov Report
Merging #410 (a54e85c) into master (d3a7443) will increase coverage by
0.76%. The diff coverage is100.00%.
:exclamation: Current head a54e85c differs from pull request most recent head fea0e0d. Consider uploading reports for the commit fea0e0d to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## master #410 +/- ##
==========================================
+ Coverage 94.25% 95.01% +0.76%
==========================================
Files 8 8
Lines 974 903 -71
==========================================
- Hits 918 858 -60
+ Misses 56 45 -11
| Impacted Files | Coverage Δ | |
|---|---|---|
| phys2bids/io.py | 99.50% <100.00%> (+2.86%) |
:arrow_up: |
hmmm all python 3.6 checks failed. Looks like a sonpy problem - they use the versioning numbers in a very special way (1.6.x -> python 3.6 support; 1.7.x -> python 3.7 etc)
More than that, I believe that sonpy only supports python 3.7 and above (If I understood their page ) Python 3.6 reaches its EOL in a month, so I see two options here:
- we add an exception to not run this test when running python 3.6, or
- we can speed up things and end support for python 3.6 earlier on, removing its tests alltogether.
WDYT?
Ah good to know! I would prefer
- explicitly exclude 3.6 for sonpy related functions
- end support for 3.6 in future iteration.
Dealing with deprecation and adding a new function in one PR might be too much
Agreed! Let's exclude 3.6 testing for sonpy. Do you need help with it?
I will have a look and likely working on this next week
@htwangtw I tried to update this PR to merge it in. At the moment, I still cannot figure out how to fix the installation of sonpy - mainly due to the fact that python 3.10 cannot install it.
As a temporary solution, I marked as xfail the sonpy test. I don't love this, but I don't know how to solve it at the moment.
If you agree with the changes, we merge!
:rocket: PR was released in 2.9.0 :rocket: