-
Notifications
You must be signed in to change notification settings - Fork 90
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
[ENH, MRG] Allow template coordinate frame writing #980
Conversation
@adam2392 these should all come back green, I think this would be nice to have in the release tomorrow but they should be reviewed. Do you have some time today to do a bit more thorough review. I've tested and it should be good but ideally it wouldn't break anything on the stable version! |
Codecov Report
@@ Coverage Diff @@
## main #980 +/- ##
==========================================
+ Coverage 94.72% 94.99% +0.27%
==========================================
Files 25 25
Lines 3698 3678 -20
==========================================
- Hits 3503 3494 -9
+ Misses 195 184 -11
Continue to review full report at Codecov.
|
mne_bids/config.py
Outdated
@@ -289,7 +285,7 @@ | |||
MNE_FRAME_TO_STR = {val: key for key, val in MNE_STR_TO_FRAME.items()} | |||
|
|||
# see BIDS specification for description we copied over from each | |||
BIDS_COORD_FRAME_DESCRIPTIONS = { | |||
BIDS_COORD_FRAME_DESCRIPTIONS = dict(**{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh there's gotta be a better way to do this. In the worst case, simply first create a dict and then append to it / update it, please.
with warnings.catch_warnings(): | ||
warnings.filterwarnings(action='ignore', category=RuntimeWarning, | ||
message='.*nasion not found', module='mne') | ||
raw.set_montage(montage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered setting the verbosity level of set_montage()
to 'error'
? (I didn't take a look at this method, not sure if it even supports verbosity!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be other warnings though... wouldn't want to miss those
with warnings.catch_warnings(): | ||
warnings.filterwarnings(action='ignore', category=RuntimeWarning, | ||
message='.*nasion not found', module='mne') | ||
raw.set_montage(montage, on_missing='warn') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above: can you maybe change the verbosity level?
with pytest.warns(RuntimeWarning, match="Skipping EEG electrodes.tsv"): | ||
with pytest.raises(RuntimeError, match="'head' coordinate frame " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, what? So this is a breaking behavior change? If yes, we might need a deprecation cycle for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is anything to cycle, it's raising an error where before there was a warning. I think this is appropriate and needed; I really don't like when among all the things that are printed out you get a warning that the channels weren't written which is kind of a big deal if you think they are supposed to be. This is a pretty edge case anyway, when you have a montage in head
with no fiducials.
@alexrockhill We can also postpone the release to Wednesday or so, so you have more time to get this here cleaned up & tested |
Okay, trying to respond to all comments and test right away not to hold things up |
There was one part of the coverage I wasn't able to get to: when |
Ah that was an annoying bug, I modified the raw when passing it to |
Ok to merge @hoechenberger and @adam2392 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I realize we don't support pyvista and 3D plots in the doc of mne-bids... to be done later I guess
Thanks, @alexrockhill! |
Those are block quotes, not actual executed code since we don't have that template in the sample data. I wouldn't doubt that the 3D scraper is also not implemented but they shouldn't render. |
arfff should we add this in mne-bids to make sure this code does not rot?
… Message ID: ***@***.***>
|
Sure, actually while I was writing my response, I thought that |
There were a few issues with this PR but I'm almost done fixing and rewriting the example (I think the |
Fixes last part from #973
Merge checklist
Maintainer, please confirm the following before merging: