-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fix chpi write #1067
Fix chpi write #1067
Conversation
which is at least partially responsible for the tests failing |
@eort can you make your PR draft if it’s not ready yet ? 🙏 |
agreed
can you please add some logic such that this new feature is only used when an adequate version of mne-python is present, and else the old code is used? You can also add a comment like Same for a test: just use the "skipif" decorator that you can already find in several other tests. |
Yes, I can do that. I don't think leaving the old code makes a lot of sense though, because the old code gives incorrect information (always claiming chpi was present). But like Eric pointed out, the
I couldn't find any 'live' usage of this decorators. Regardless, can they be used if those version checks are only relevant for neuromag files? The behavior for CTF and KIT files hasn't change. |
The changes you pushed LGTM, thanks! If you could also add a changelog entry, I think this becomes mergeable. We just need to inspect the CI log very well to make sure no "new issues" are introduced, and errors are all due to expected shortcomings (see discussion in #1066) |
Talking about introducing new issues... What is preferred behavior in case it cannot be determined whether a field is True or False? Is it setting it to |
in the case of missing data, if it is metadata that BIDS considers optional, leaving it out completely is preferred IMHO. If it is recommended and we don't have info, we need to set it to |
Both |
Turns out things are more complicated than I thought.
|
Ah, I see. I think it should be possible to specify |
mh, after checking again the specifications, I came across this passage:
Given that we are talking about optional fields here, I think adding |
😮💨 shame on me, because I was the one adding that sentence to the spec. And I didn't remember when I wrote what I did above. Thanks for double checking @eort |
no prob. Seems unrealistic to remember all details of a 500 pages doc ;) So only thing that needs to be done still, is the api change in |
Co-authored-by: Richard Höchenberger <richard.hoechenberger@gmail.com>
Co-authored-by: Richard Höchenberger <richard.hoechenberger@gmail.com>
Co-authored-by: Richard Höchenberger <richard.hoechenberger@gmail.com>
there are still problems in mne.chpi.get_active_chpi(). Once they are solved, I shall try once again to get this thing to work |
Codecov Report
@@ Coverage Diff @@
## main #1067 +/- ##
==========================================
- Coverage 95.20% 95.01% -0.19%
==========================================
Files 25 24 -1
Lines 3840 3835 -5
==========================================
- Hits 3656 3644 -12
- Misses 184 191 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I marked this ready for review, because I don't think the CI failures are related to the introduced changes. Also code coverage decrease is not a real decrement in my opinion, at least I don't see obvious ways to increase it. |
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.
LGTM, thanks @eort for working on this and the added functionality in mne-python!
oh but actually, we do get one error that seems related, see: https://github.com/mne-tools/mne-bids/actions/runs/3080131213/jobs/4977127367#step:14:5540
|
oh indeed. I missed that among all the matplotlib errors. I am confused about the message though. It says that it fails to properly handle a In any case, the problem seems to be that all system that are not KIT or CTF are lumped into one category, assuming those must be neuromag then. So, we could change it to an elif, and throw and notimplementederror for the else case? |
yes, seems like it -- I don't know how (would need to read more carefully) but it seems like you need to fix exactly that logic. |
I used the same logic as in https://github.com/mne-tools/mne-python/blob/de546e2188761de69eede103b7c5a6cc09542a4d/mne/chpi.py#L1392 and restructured the entire if-else section accordingly. |
I don't see anything wrong with the reported problems, but better check for yourself |
Thank you @eort 🎉 |
PR Description
closes #940
Given the added functionality in mne-python, I adapted the way the status of the hpi's is determined for neuromag files. Essentially, if any of the hpi's were active for at least one timepoint the field is set.
I wasn't sure what to do about the
HeadCoilFrequency
field. It seems like it is set regardless of the hpi status, but I think it is confusing (and rather pointless), to have the frequencies listed even though non of them were active. So I set them to None in case of inactive hpi.Also the functionality would require the latest version of mne-python (1.2)
Merge checklist
Maintainer, please confirm the following before merging.
If applicable: