ENH: Add channel block information#33
Conversation
larsoner
left a comment
There was a problem hiding this comment.
@mkajola @jnenonen I tried to mostly follow your proposal, but added some comments inline about why I made specific choices. Feel free to look on GitHub and comment inline where needed!
Companion PR in MNE is mne-tools/mne-python#8574
| #... | ||
| #<free> 3999 - | ||
| # | ||
| #============================================================================================================== |
There was a problem hiding this comment.
Removed all of this because it's clearer just to point people to the companion file I think.
There was a problem hiding this comment.
Sorry, maybe I did not quite get what was the change. I suppose these lines were just a placeholder to show a free tag range?
There was a problem hiding this comment.
There is the ch_name_list 3507 farther up, but this is redundant with the definition in the _MNE.txt
DictionaryTags.txt
Outdated
| ch_unit_mul 257 int32 rel "Unit multiplier exponent. | ||
| ch_dacq_name 258 string - "Name of the channel in the data acquisition system. Corresponds to fiffChInfoRec.name." | ||
| #<reserved> 259 | ||
| ch_coil_type 259 int32 - "Coil type in coil_def.dat" |
There was a problem hiding this comment.
This was one of two entries that is in the fiffChInfoRec but not in the spec
There was a problem hiding this comment.
The # tags are reserved. In practice that means that somewhere in this universe there are files that are using the tags, but they are for some reason withdrawn or not documented. So lets avoid them.
DictionaryTags.txt
Outdated
| :channel info extension | ||
| #============================================================================================================== | ||
| #<free> 4100 | ||
| ch_coord_frame 4101 int32 - "Channel coordinate frame" |
There was a problem hiding this comment.
This is one thing that is missing from the channel info. Currently the coord_frame is taken based on the channel type (MEG: device, EEG: head), but it's cleaner just to encode it directly. We're out of constants in the 250-ish range, so I reserved 100 slots for volume (above) and started a new potential range for channel information or other info in the next free block.
There was a problem hiding this comment.
Very good point. An explicit coordinate frame is definitely better than implicit. I have nothing against that. New things should use it. Unfortunately if somebody needs backwards compatibility, the reader needs to know the implicit ones.
There seem to be some space available around 350+ (I hope we never have tens of different ways to encode data).
This is also the correct time to specify exactly what each thing means, and think about is this compatible with future. This probably goes to the other pull, but there should be convenient way to have more text on the descriptions.
There was a problem hiding this comment.
Unfortunately if somebody needs backwards compatibility, the reader needs to know the implicit ones.
I think this part is okay -- existing readers already implement this logic. So it should be backward compatible, and any new readers will need to be compatible with the (many, many) files without a FIFFB_CH_INFO block anyway.
There seem to be some space available around 350+
I'll push a commit to move them down there.
This is also the correct time to specify exactly what each thing means, and think about is this compatible with future.
At least these two additions seem fairly clear/unambiguous in the context of channel information. But I'll make a comment in the other issue about this more general problem.
|
This is general one on the development. |
larsoner
left a comment
There was a problem hiding this comment.
@mkajola I've pushed a commit to address your comments, feel free to look again when you get a chance.
Is the current branching scheme enough, if we start to develop the spec further here in Github. That would mean that there will be "experimental" specs, and I would expect that head of the master is "valid".
Typically the way I've seen projects work on GitHub is that master is the branch that all downstream users -- for this project that's MNE-* and MEGIN software mostly -- work to be compatible with. People make Pull Requests (PRs) like this one that have a branch in a fork with some changes that are basically a proposal to improve upstream master in some way. Once everyone agrees, it gets merged and people start making use of it in their code (often after a release is made, though power "users" might not wait, and just rely on master having a stable public API).
And every once in a while an official release is made. fiff-constants doesn't change all that much, so it's not too bad to do a release any time a sufficiently large change is made. I think this would justify releasing a 1.5.0, so I put it under that milestone (and there is nothing else currently): https://github.com/mne-tools/fiff-constants/milestone/1
Another is question about github - is there comment/discussion area with "branch-scope"? Or is that in pull requests only.
This PR is a request to merge my branch within my fork larsoner/rename-block into the upstream fiff-constants/master branch. So in this sense, it already has "branch scope". It is possible to have branches other than master within fiff-constants itself, but it's best to avoid this if possible because
- It's easier to think of everyone as working within their own forks to add things to a single branch (
master) than to have separate branches withinfiff-constantsthat people might actually be using, and - While I could have made a
fiff-constants/rename-blockbranch and done the same PR process to request to merge the changes intofiff-constants/master, it's more annoying when working with other people to do it this way, and also more risky (people doinggit fetch upstreamwill always see a bunch of branches; I could accidentally push tofiff-constants/masterinstead offiff-constants/rename-block, etc.).
The PR workflow I've followed here has become a sort of de facto GitHub public development "standard procedure" I think. There are different ways to do it of course -- git and GitHub are quite flexible. But staying with this semi-standard way of doing things makes troubleshooting and contributing elsewhere easier / more consistent.
| #... | ||
| #<free> 3999 - | ||
| # | ||
| #============================================================================================================== |
There was a problem hiding this comment.
There is the ch_name_list 3507 farther up, but this is redundant with the definition in the _MNE.txt
DictionaryTags.txt
Outdated
| :channel info extension | ||
| #============================================================================================================== | ||
| #<free> 4100 | ||
| ch_coord_frame 4101 int32 - "Channel coordinate frame" |
There was a problem hiding this comment.
Unfortunately if somebody needs backwards compatibility, the reader needs to know the implicit ones.
I think this part is okay -- existing readers already implement this logic. So it should be backward compatible, and any new readers will need to be compatible with the (many, many) files without a FIFFB_CH_INFO block anyway.
There seem to be some space available around 350+
I'll push a commit to move them down there.
This is also the correct time to specify exactly what each thing means, and think about is this compatible with future.
At least these two additions seem fairly clear/unambiguous in the context of channel information. But I'll make a comment in the other issue about this more general problem.
|
Hello Eric, And for the (fiff) tags, they look fine too. One small thing. I think that the data type of ch_coord_frame is enum(coord), and ch_coil_type is enum(coil), so that are bound to a specific value set and enums are ints anyway. The description should be 'application agnostic', so referring coildef.dat is not quite optimal. |
Done!
Yeah these seem like If you and @jnenonen are happy with this version, feel free to click the big green button! I usually do a "Squash and merge" because it puts all the changes into a single commit automatically, which keeps repository size small and makes |
|
Ok, done. |
Better solution for channel names > 15 chars.