-
Notifications
You must be signed in to change notification settings - Fork 5
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
New method request: dosdp normalise #80
Comments
Hi Nico, yes this is in my todo list. You can assign it to me. |
I faced some issues while ordering comments. Ruamel.yaml is associating comments with the preceding element (https://stackoverflow.com/a/42173906). Based on the context, this behavior sometimes make sense, but sometimes cause confusion. For example:
So in this case both comments belong to
Do you have any suggestions for the fix. Or, we can release the initial version as is (just warn user to check comments in the pattern file) and try to fix this issue in later versions. |
Hmmm... interesting.. I am fine with a warning for now.. I don't think you can really do much, I don't think it is worth it to write a new parser.. I would suggest to add to the style guides that comments should be under the elements they pertain to. |
Hmmm. I think that moving comments around risks making well annotated patterns confusing. @matentzn - can you remind me of the rationale for this again. I don't see a massively strong case for improving diffs (please correct me if I'm wrong). If it's just about readability then doesn't the markdown conversion deal with that? (we could add cannonical ordering there). |
I think having comments in a pattern like this is an antipattern all by itself, but that is another discussion. Well, the question you are asking is the same as: "Is I am definitely pro having a normalise method, and I would recommend we go ahead, but I am not dying on that hill. It feels like having a |
We need a method in dosdp which takes in a dosdp yaml file an returns it in a nicely canonical form:
We will use the ordering directly from the json schema, its perfect:
https://github.com/INCATools/dead_simple_owl_design_patterns/blob/master/src/schema/dosdp_schema.yaml#L299
Test data (bad examples):
https://github.com/monarch-initiative/mondo/tree/master/src/patterns/dosdp-patterns
Good example (mostly good):
https://github.com/obophenotype/upheno/blob/master/src/patterns/dosdp-patterns/abnormalAnatomicalEntity.yaml
I used this script back in the days:
https://github.com/monarch-initiative/mondo/blob/master/src/scripts/repair_mondo_patterns.py
vars
'''
-> rather"'
if necessary.The text was updated successfully, but these errors were encountered: