Repository navigation
[MRG] Annotation fix to allow Semicolons in Description - #7288
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7288 +/- ##
==========================================
+ Coverage 89.69% 89.81% +0.11%
==========================================
Files 447 447
Lines 80608 80716 +108
Branches 12882 12876 -6
==========================================
+ Hits 72301 72492 +191
+ Misses 5447 5394 -53
+ Partials 2860 2830 -30 |
|
I suspect the issue comes from saving the file to fif. However I agree that we should not prevent ";" unless you want to save it to a .fif file. |
|
And even in that case we can probably sanitize with a substitution like |
|
agreed
… |
|
In Is this already doing that? |
|
Maybe? I would need to look at the code more closely to know, but really what I would do first (before changing any MNE code) is write a little test (following test-driven development): On Then with your commenting out of lines this happens: So it replaces My suggestion above should get this to pass. |
|
So it turns out that when you save a The tests pass, but I'm wondering is it necessary to add some documentation to the docstrings regarding this behavior? |
|
I fear this will break reading files made with an older version of MNE |
I'm not sure what you mean -- the separator in the FIF file on disk will still be In any case, the changes in this PR are just to sanitize (and un-sanitize) descriptions Basically before the |
|
@larsoner if you think it can be merged fair enough. |
larsoner
left a comment
There was a problem hiding this comment.
Other than a minor wording suggestion (it's no longer a character but a substring), +1 for merge from me
Co-Authored-By: Eric Larson <[email protected]>
|
@larsoner cool sounds good! fixed it up. Thanks. |
|
Thanks @adam2392 ! |
|
Ahh, forgot |
This is essentially what happened here though ? I had Now loading these Am I missing something @larsoner ? |
|
Yes that might still be the case :( Would a workaround like this work for you? It should be backward compatible / work on 0.19 and 0.20: In principle we could add a |
|
Yeah I guess I'll be using this workaround, until I convert my The |
* Adding use_scalebars as a parameter. * Fixed to adhere to mne-coding standards. * Fixing formatting issues. * Fixing show_scalebars in viz ica from the original naming of use_scalebars. * Update mne/viz/ica.py Co-Authored-By: Daniel McCloy <[email protected]> * Update mne/viz/raw.py Co-Authored-By: Daniel McCloy <[email protected]> * DOC: Correct version [ci skip] * Remove semicolon. * Delete test.py * Fixing annotations bug. * Adding unit test annotations. for expected error. * Update mne/annotations.py Co-Authored-By: Eric Larson <[email protected]> Co-authored-by: Daniel McCloy <[email protected]> Co-authored-by: Eric Larson <[email protected]>
* Adding use_scalebars as a parameter. * Fixed to adhere to mne-coding standards. * Fixing formatting issues. * Fixing show_scalebars in viz ica from the original naming of use_scalebars. * Update mne/viz/ica.py Co-Authored-By: Daniel McCloy <[email protected]> * Update mne/viz/raw.py Co-Authored-By: Daniel McCloy <[email protected]> * DOC: Correct version [ci skip] * Remove semicolon. * Delete test.py * Fixing annotations bug. * Adding unit test annotations. for expected error. * Update mne/annotations.py Co-Authored-By: Eric Larson <[email protected]> Co-authored-by: Daniel McCloy <[email protected]> Co-authored-by: Eric Larson <[email protected]>
Thanks for contributing a pull request! Please make sure you have read the
contribution guidelines
before submitting.
Reference issue
Fixes: #7287
What does this implement/fix?
WIP, attempts to check if removing the ";" check breaks anything.
Additional information
See Issue for sample data.