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

[MRG] RF: Rework get_matched_empty_room() #421

Merged
merged 5 commits into from May 25, 2020

Conversation

hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented May 20, 2020

PR Description

Closes #419

Merge checklist

Maintainer, please confirm the following before merging:

  • All comments resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • PR description includes phrase "closes <#issue-number>"
  • Commit history does not contain any merge commits

@hoechenberger hoechenberger marked this pull request as ready for review May 20, 2020 11:41
@hoechenberger
Copy link
Member Author

Except for the missing tests and changelog entries, this should be ready for review. Note that I'm currently not utilizing scans.tsv as originally proposed in #419. I think we should open a separate PR for this and add this feature in all relevant places if we want it – not just for empty-room recordings.

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2020

Codecov Report

Merging #421 into master will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #421   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          12      12           
  Lines        1616    1658   +42     
======================================
- Misses       1616    1658   +42     
Impacted Files Coverage Δ
mne_bids/read.py 0.00% <0.00%> (ø)
mne_bids/utils.py 0.00% <0.00%> (ø)
mne_bids/write.py 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e3499d...8c6ce43. Read the comment docs.

mne_bids/read.py Outdated Show resolved Hide resolved
mne_bids/read.py Outdated Show resolved Hide resolved
mne_bids/read.py Outdated Show resolved Hide resolved
mne_bids/read.py Outdated Show resolved Hide resolved
mne_bids/read.py Outdated Show resolved Hide resolved
mne_bids/write.py Outdated Show resolved Hide resolved
@jasmainak
Copy link
Member

jasmainak commented May 21, 2020

@hoechenberger looks like the CIs are failing. Also can you check of the items in the checklist above once you are ready?

My main comment is about using Pathlib. If we decide to do this, we should do it consistently in the whole repo so it's easier to read the code.

Thanks for fixing this function!

@hoechenberger
Copy link
Member Author

@hoechenberger looks like the CIs are failing. Also can you check of the items in the checklist above once you are ready?

Yes still a bit WIP :)

My main comment is about using Pathlib. If we decide to do this, we should do it consistently in the whole repo so it's easier to read the code.

Yep I agree. Will revert this to os.path / glob.glob for now.

@hoechenberger hoechenberger force-pushed the emptyroom-path branch 2 times, most recently from 9fc4e93 to e13ded3 Compare May 22, 2020 10:18
@hoechenberger
Copy link
Member Author

I will move the "move the core of make_bids_basename() to a private function so we can call it internally with some fancy additional arguments" stuff to a separate PR to make the diff of this one smaller

@hoechenberger
Copy link
Member Author

Will rebase this branch once #427 has been merged.

@hoechenberger hoechenberger force-pushed the emptyroom-path branch 3 times, most recently from 682f81e to 2e4e857 Compare May 23, 2020 08:12
@hoechenberger
Copy link
Member Author

It appears to me that empty-room recordings do not necessarily need to have task-noise set, am I understanding this correctly? https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/02-magnetoencephalography.html#empty-room-meg-recordings

cc @sappelhoff

@sappelhoff
Copy link
Member

mh yes, there is no MUST or REQUIRED, only

TaskName in the *_meg.json file should be set to "noise".

not even a capital SHOULD ☹️

Did you check whether the validator throws a tantrum if you have, e.g. task-BLA?

@hoechenberger
Copy link
Member Author

not even a capital SHOULD ☹️

Yep... somebody SHOULD have put one there LOL

Did you check whether the validator throws a tantrum if you have, e.g. task-BLA?

No I haven't checked. Anyway, we're supporting READING those files now, but we're not allowing users to CREATE them. Which is probably good?

@hoechenberger
Copy link
Member Author

Did you check whether the validator throws a tantrum if you have, e.g. task-BLA?

No I haven't checked. Anyway, we're supporting READING those files now, but we're not allowing users to CREATE them. Which is probably good?

Just checked, and no, it does not complain, neither for a missing task, nor for a non-noise task.

@hoechenberger
Copy link
Member Author

@jasmainak I think I'm done here, are you happy with these changes?

@jasmainak
Copy link
Member

@hoechenberger no test to update?

@jasmainak
Copy link
Member

also a CI is failing, is it related to this PR?

@hoechenberger
Copy link
Member Author

@hoechenberger no test to update?

I was gonna add some, but it's so painful… the current tests are so convoluted and full of side-effects that I find it extremely frustrating to add to the existing tests. But you're right, will look into this.

also a CI is failing, is it related to this PR?

The GH Actions infrastructure is still WIP for us, so you can ignore this for now :)

@jasmainak
Copy link
Member

but it's so painful

@agramfort says "no pain, no gain" :P

@hoechenberger
Copy link
Member Author

I ran int an upstream bug that needs to be fixed first for my tests to work:
mne-tools/mne-python#7816

(Update: Apparently it's not a bug…)

@agramfort says "no pain, no gain" :P

I say, "If there's too much pain, maybe you should pick your brain" :D I'd like to refactor the tests sometime in the future, I don't believe in overly complex & long tests :)

@agramfort
Copy link
Member

@hoechenberger you need to rebase.

@hoechenberger
Copy link
Member Author

hoechenberger commented May 24, 2020

@agramfort I'm currently being blocked by mne-tools/mne-python#7816 as it prevents me from adding a test which I have already written

@hoechenberger
Copy link
Member Author

Please do not merge yet.

@jasmainak
Copy link
Member

We won't merge until you set WIP to MRG :)

weird that the meas_date bug keeps coming back ... I thought we had tests in MNE to deal with that.

@hoechenberger hoechenberger changed the title WIP: RF: Rework get_matched_empty_room() [MRG] RF: Rework get_matched_empty_room() May 25, 2020
@hoechenberger
Copy link
Member Author

This is good to merge.

Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

besides this minor thing +1 for MRG

mne_bids/utils.py Outdated Show resolved Hide resolved
@hoechenberger hoechenberger merged commit a8389c2 into mne-tools:master May 25, 2020
@jasmainak
Copy link
Member

I know you want to move fast but please never merge your own PR :) Unless it's really a trivial one and there's nobody else to merge.

@hoechenberger
Copy link
Member Author

Oh ok, sorry about that! Thought once positive reviews are in, it doesn't matter. But will follow this direction in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make get_matched_empty_room() more robust
5 participants