phys2bids icon indicating copy to clipboard operation
phys2bids copied to clipboard

NF/ADD CED spike2 file IO

Open htwangtw opened this issue 4 years ago • 7 comments
trafficstars

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!

htwangtw avatar Jul 21 '21 10:07 htwangtw

~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.

htwangtw avatar Jul 21 '21 16:07 htwangtw

Codecov Report

Merging #410 (a54e85c) into master (d3a7443) will increase coverage by 0.76%. The diff coverage is 100.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

Impacted file tree graph

@@            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:

... and 5 files with indirect coverage changes

codecov[bot] avatar Nov 22 '21 10:11 codecov[bot]

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)

htwangtw avatar Nov 22 '21 13:11 htwangtw

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?

smoia avatar Nov 22 '21 14:11 smoia

Ah good to know! I would prefer

  1. explicitly exclude 3.6 for sonpy related functions
  2. end support for 3.6 in future iteration.

Dealing with deprecation and adding a new function in one PR might be too much

htwangtw avatar Nov 22 '21 15:11 htwangtw

Agreed! Let's exclude 3.6 testing for sonpy. Do you need help with it?

smoia avatar Nov 24 '21 10:11 smoia

I will have a look and likely working on this next week

htwangtw avatar Nov 24 '21 14:11 htwangtw

@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!

smoia avatar Apr 27 '23 00:04 smoia

:rocket: PR was released in 2.9.0 :rocket:

smoia avatar Apr 27 '23 00:04 smoia