-
Notifications
You must be signed in to change notification settings - Fork 88
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
[WIP] Refactor write/read electrodes to a separate function & included coordinate system descriptions #416
Conversation
@jasmainak lmk what you think? I think the file separation and function separation makes the whole electrodes/coordsystem business a lot cleaner. I added back in the scalp EEG only allowing the Added more configuration definitions which were from BIDS specification that we can get for free. E.g. the CoordinateSystemDescription field. |
sorry for the delay @adam2392 @hoechenberger @sappelhoff would you mind taking a first pass? I'll look in a couple of days |
@adam2392 the diff is huge. Part of the reason is that you have moved things around. Github doesn't do a good job of tracking changes when you move things. Plus it's difficult to review. What I suggest is to break down the PR into two parts
Ideally, 1. can be merged without much review and for 2., we will do the actual review. Do you think this is possible? Also it would be really helpful if you can summarize in a concise comment what you moved where and any other changes that needed to be done. |
Summary Once the simple "move of functions to dig.py" PR in #425 is merged, these are the things left to do:
|
@adam2392 I am lost. What should get in first? what is good to go from your end? |
Sorry first time making such a large change... #425 should go in first according to @jasmainak comments. This PR is just moving the existing code out of write.py and read.py. The next PR will address the remaining check list. |
@adam2392 sounds like a plan, please update the PR description so that this is not lost in a comment. |
Codecov Report
@@ Coverage Diff @@
## master #416 +/- ##
==========================================
- Coverage 94.40% 94.29% -0.11%
==========================================
Files 12 12
Lines 1537 1596 +59
==========================================
+ Hits 1451 1505 +54
- Misses 86 91 +5
Continue to review full report at Codecov.
|
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.
@jasmainak @sappelhoff please have a look before merging
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.
looks nice @adam2392 thanks a lot :-)
I left a few comments.
Co-authored-by: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
Co-authored-by: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
Co-authored-by: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
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.
okay, almost done from my side. Just three things I didn't notice in my first pass!
Co-authored-by: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
Co-authored-by: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
Co-authored-by: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
thx @adam2392 we're making fast progress here ! |
PR Description
Closes: #398
The main portion refactors writing and reading electrodes.tsv files into a
_write_dig_bids
and_read_dig_bids
functions, and also includes coordinate system descriptions when writing coordsystem.json files. This is a move to help uncomplicate theread_raw_bids
andwrite_raw_bids
functions when dealing w/ electrode coordinates. Eventually, the _write/read_dig_bids funcs could add a public API even?Summary
This is part 1 to address comments at: #416 (comment). This will move all related electrodes.tsv and coordsystem.json reading/writing files over to a dig.py. In addition, it makes some minor changes to the naming of the
BIDS_COORDINATE_UNITS
.Once the simple "move of functions to dig.py" PR in #425 is merged, these are the things left to do:
mne-bids/mne_bids/read.py
Lines 554 to 555 in 47ad7dd
_read_dig_bids()
function and tidy up the logicmne-bids/mne_bids/write.py
Lines 1257 to 1258 in 47ad7dd
_write_dig_bids()
function and tidy up the logic_write_dig_bids()
, only allowing writing if the landmarks (NAS, LPA, RPA) are present (I'm okay if you want me to table this one, but had this stored from a previous PR, so figured it's easy to add)Merge checklist
Maintainer, please confirm the following before merging: