-
Notifications
You must be signed in to change notification settings - Fork 10
8000 Automatic definitions versioning for nxs file #124
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
Conversation
Pull Request Test Coverage Report for Build 6733820332
💛 - Coveralls |
Looks good |
FAIRmat-NFDI/nexus_definitions#81 deals with versioning for the nexus definitions. We can just use this from the submodule or integrate our own version of it here. |
1368cf5
to
2b4f7f3
Compare
This is neat. I would vote for having this in the submodule with the definitions though. Seems cleaner to have it next to what it's versioning. |
Yes, this would be my preferred solution, too (+ the implementation here does it like this). Initially, I wasn't sure whether pynxtools would be able to get the function from the module as nexus_definitions are not really a python module, but obviously this works. |
9f8c8f8
to
7468544
Compare
This is a bit hacky but works. It tries to get the nexus version from git, or from This implements everything inside pynxtools, so there is nothing new necessary to be added in nexus_definitions. This has to be this way due to the build process hook. So the question is if we still want to add FAIRmat-NFDI/nexus_definitions#81 and propose this to niac or just leave it out. |
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 only have suggestion. We should add nexus-version.txt
to .gitignore
to make sure one of us doesn't commit that by mistake. From what I understand, that file should not exist outside of the Python wheel.
Other than that this looks fine to me.
Yes. It's already ignored since we have |
@sanbrock Shall we also add an |
Hey @sherjeelshabih, I changed the order in which the NXroot attributes are populated and emit a warning if they are already present. Can you check if this is fine with you as a general approach (we can then continue the discussion in #174 and see if we want to build something on top)? Other than that this PR should be good to go now :) |
Hey, Florian. I'm in favor of the approach to warn and update users of the wrong attributes they add. But I see an issue with the implementation right now. The update_and_warn function and the add_default_attributes is not really adding these values to the NeXus file. It corrects them in the Template. Then the template does not get written. You should change the order back in the convert.py function. |
Nevermind. There was no |
This adds an example for writing the nexus version and pynxtools version into an ellipsometry file and NXroot (for every file). It tries to extract the versions from git tags and commits, creating version numbers like
v2023.10-10-g<hash>
(for nexus_definitions) to show that the current state has a commit distance of 10 compared to thev2023.10
tag and also includes the git hash of that commit. For pynxtools it uses setuptools-scm (i.e., yielding a similar version tag)..../definition/url
[ ] Add git hash in/entry/program_name/@url
Fixes #162