-
Notifications
You must be signed in to change notification settings - Fork 163
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] Correct entity names in YAML files #720
Conversation
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.
Thanks @tsalo
Can I ask, why did you switch from keys to entity names? I am asking because for me the old way was much better, as I was reading the schema files to check bidskeys. Do you know, how can I now translate the entity names back to keys? |
From what I can recall, the main reasons are (1) the schema files are tool-centric, so it made sense to use the tool-centric variable names, and (2) we wanted the more explanatory names, but couldn't figure out a good name for the field. Using those names as the keys meant we didn't have to come up with a term for them. In terms of translating the names back to keys, in our current code we just reference the "entity" field as we search through available entities, rather than using the keys. It makes the code slightly more complicated, but I think it's still solid. |
I am not sure I can fully follow what you are saying but what I meant is that I used the datatype files to check that e.g. the required |
Is there a mapping somewhere that maps entity names to keys? To me using the key names to define whether the key is required or not seems the most logical thing to do. |
What the entities are is already (much better) described in |
Besides, there you don't use the entity name. See e.g. this snippet where the old inversion:
name: Inversion Time
entity: inv
description: |
If files belonging to an entity-linked file collection are acquired at different
inversion times, the `_inv-<index>` key/value pair MUST be used to distinguish
individual files.
This entity represents the `InversionTime` metadata field. Please note that the `<index>`
denotes the number/index (in the form of a nonnegative integer), not the `InversionTime`
value which needs to be stored in the field `InversionTime` of the separate JSON file.
format: index |
Ah wait, now I see that the |
Yes, so the entities["inversion"]["entity"] == "inv" |
Thanks! Not really important, but wouldn't it then be better to use inversion:
name: Inversion Time
key: inv
description: |
[..] and entities["inversion"]["key"] == "inv" |
This corrects a problem with the CI identified in #719. In #610 we switched to using the entity names, rather than keys, in the datatype YAML files, while in #714 we changed those names for a couple of entities. As such, the old names are referenced in the datatype YAML files, which causes a conflict with the rendering code.