-
Notifications
You must be signed in to change notification settings - Fork 3
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
Pipeline: Namespace management update. #29
base: pipeline
Are you sure you want to change the base?
Pipeline: Namespace management update. #29
Conversation
…be corrected with core and computation commit. update_commits.py is updated but not tested.
@Raphael-Gazzotti sorry for causing the conflict here by merging #28 . can you please update? |
…be corrected with core, computation, controlledTerms last PRs. update_commits.py is updated but not tested.
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.
I think it's okay, but I had to go through it on my phone. @apdavison @olinux please double check and verify
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.
Functionally this seems reasonable, although I haven't run it to check.
I've made a few suggestions to make the code easier to understand.
openMINDS_pipeline/resolver.py
Outdated
if version == "latest" or float(version[1:]) >= 4: | ||
if TEMPLATE_PROPERTY_LINKED_TYPES in schema_payload["properties"][p]: | ||
schema_payload["properties"][p][TEMPLATE_PROPERTY_LINKED_TYPES] = [ | ||
schema.namespaces['types'] + _type.split(":")[-1].split("/")[-1] if (_type.__contains__( |
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.
This list comprehension is very hard to understand, and reoccurs a few lines down for embedded types. I suggest breaking this out into a function, and perhaps assigning _type.split(":")[-1].split("/")[-1]
to a variable with a meaningful name; at a minimum more comments are needed.
Also, _type.__contains__(x) == True
should be written as x in _type
.
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.
I've simplified the logic and removed unnecessary code, it should be better now.
openMINDS_pipeline/resolver.py
Outdated
# Only SANDS is in uppercase in schema_group | ||
if s.schema_group == "SANDS": | ||
result[c].append('sands:' + s.type) | ||
else: | ||
result[c].append(s.schema_group + ':' + s.type) |
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.
Could this be changed to
result[c].append(s.schema_group.lower() + ':' + s.type)
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.
It can't be applied here, because of the prefixes specimenPrep and controlledTerms, but I can do a replace instead of a condition.
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.
Ok, then maybe it is clearer to leave as is
PR#6 in neuroimaging should be accepted before this one and I will update the versions-dev.json file accordingly. |
versions files should be corrected with future core, computation and neuroimaging commits.
update_commits.py is updated but not tested.