Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MATLAB files #360

Merged
merged 12 commits into from
Nov 29, 2020
Merged

Add support for MATLAB files #360

merged 12 commits into from
Nov 29, 2020

Conversation

vinferrer
Copy link
Collaborator

@vinferrer vinferrer commented Nov 27, 2020

Closes #25 and closes #292

Proposed Changes

  • add load_mat function to io.py
  • add test for this new function
  • acknowledge @eurunuela work on this

Change Type

  • bugfix (+0.0.1)
  • minor (+0.1.0)
  • major (+1.0.0)
  • refactoring (no version update)
  • test (no version update)
  • infrastructure (no version update)
  • documentation (no version update)
  • other

Checklist before review

  • I added everything I wanted to add to this PR.
  • [Code or tests only] I wrote/updated the necessary docstrings.
  • [Code or tests only] I ran and passed tests locally.
  • [Documentation only] I built the docs locally.
  • My contribution is harmonious with the rest of the code: I'm not introducing repetitions.
  • My code respects the adopted style, especially linting conventions.
  • 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!

@vinferrer vinferrer closed this Nov 27, 2020
@vinferrer vinferrer reopened this Nov 27, 2020
@codecov
Copy link

codecov bot commented Nov 27, 2020

Codecov Report

Merging #360 (5f4b837) into master (9e29b7a) will decrease coverage by 0.16%.
The diff coverage is 90.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
- Coverage   94.80%   94.63%   -0.17%     
==========================================
  Files           8        8              
  Lines         808      839      +31     
==========================================
+ Hits          766      794      +28     
- Misses         42       45       +3     
Impacted Files Coverage Δ
phys2bids/phys2bids.py 88.06% <0.00%> (-1.53%) ⬇️
phys2bids/io.py 99.39% <100.00%> (+0.12%) ⬆️
phys2bids/utils.py 98.52% <100.00%> (ø)

@vinferrer
Copy link
Collaborator Author

Do we want an integration test for mat extension files?

@eurunuela
Copy link
Collaborator

I would say no. It should be enough if we unit test how the data is read and what it's transformed to. Once the mat files are read and transformed, they're "just another extension".

@vinferrer vinferrer marked this pull request as ready for review November 27, 2020 18:07
@smoia smoia changed the title Add matlab support Add support for MATLAB files Nov 28, 2020
@smoia smoia added the Minormod This PR generally closes an `Enhancement` issue. It increments the minor version (0.+1.0) label Nov 28, 2020
Copy link
Member

@smoia smoia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minimal changes, but otherwise great job!

We might need to think about a smart way to run integration tests on different types (e.g. matlab, acq, ...) of the same file, but I wouldn't block this PR for that!

setup.cfg Outdated
@@ -48,6 +50,7 @@ test =
pytest >=5.3
pytest-cov
%(acq)s
%(mat)s
%(style)s
interfaces =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move interfaces before tests and just change acq and mat in tests to "interfaces"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You sure? I put this here because test were failing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if you add %(mat)s to the interfaces and move it before tests, it will work.

interfaces =
    %(acq)s
    %(mat)s
test =
    pytest >=5.3
    pytest-cov
    %(interfaces)s
    %(style)s

In fact, I will push a little patch to change the way we install phys2bids in CircleCI later, but for the moment, this would be better.

@smoia smoia self-assigned this Nov 28, 2020
@smoia
Copy link
Member

smoia commented Nov 28, 2020

Ah, sorry, I forgot one point:
you should change line 11 of phys2bids.utils: from
SUPPORTED_FTYPES = ('acq', 'txt') # 'mat', ...
to
SUPPORTED_FTYPES = ('acq', 'txt', 'mat') # , ...

@vinferrer vinferrer requested review from smoia and eurunuela November 29, 2020 11:17
Copy link
Collaborator

@eurunuela eurunuela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @vinferrer ! We're finally adding support for MATLAB 💪🏻

Copy link
Member

@smoia smoia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@smoia smoia merged commit a888870 into physiopy:master Nov 29, 2020
@smoia
Copy link
Member

smoia commented Nov 29, 2020

🚀 PR was released in 2.3.0 🚀

@smoia smoia added the released This issue/pull request has been released. label Nov 29, 2020
@vinferrer vinferrer deleted the io_matlab branch December 1, 2020 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minormod This PR generally closes an `Enhancement` issue. It increments the minor version (0.+1.0) released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for matlab files
3 participants