Closed sanbrock closed 1 year ago
nyaml2nxdl is now added to support a solution of offering a make option make nxdl
as suggested during the Code Camp. This can convert the definitions from the nxdl.xml files (which hold the single source of truth) into nyaml which is easier to edit by humans. The tool can then convert the edited yaml files back to nxdl.xml format for being committed.
This is very cool :) Some comments from code review in code camp:
I needed to run this to get make nyaml
to work:
pip install -e .
Could the above be added to the README? Alternatively, could make nymal
detect the presence of nyaml2nxdl
and recommend the above if not present?
Optional request: if I edit a .yml file generated by nyaml, could make nymal
detect the change and do the reverse conversion automatically?
Finally, I ran these steps to attempt a "round trip":
make nyaml
cd applications/nyaml
nyaml2nxdl --input-file NXmx.yaml
diff -uBb ../NXmx.nxdl.xml NXmx.nxdl.xml
The white space changes are expected, no worries. This seems like it could trip up other software though:
- group_names: ["DET", "DTL", "DTR", "DLL", "DLR"]
+ group_names: ["DET", "DTL", "DTR", "DLL", "DLR"]
Seems to have issues translated quotes inside a doc string.
new PR is under preparation for conserving micro-credits
PR #1303 is replacing this one
Facilitating the human editing of nxdl definitions in yaml. Tool converts from nxdl.xml to nyaml and backwards