8000 Write NXroot attributes by sherjeelshabih · Pull Request #170 · FAIRmat-NFDI/pynxtools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full"> Dismiss alert

Write NXroot attributes #170

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

Merged
merged 3 commits into from
Oct 27, 2023
Merged

Write NXroot attributes #170

merged 3 commits into from
Oct 27, 2023

Conversation

sherjeelshabih
Copy link
Collaborator
@sherjeelshabih sherjeelshabih commented Oct 25, 2023

Fixes #163.

This allows the Template to now accept NXroot level NXobjects. I have made a test with /@default.

Note: This makes the undocmuented warning test do nothing.

@sherjeelshabih sherjeelshabih linked an issue Oct 25, 2023 that may be closed by this pull request
@coveralls
Copy link
coveralls commented Oct 25, 2023

Pull Request Test Coverage Report for Build 6640766175

  • 4 of 4 (100.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.008%) to 51.283%

Files with Coverage Reduction New Missed Lines %
pynxtools/dataconverter/convert.py 1 85.15%
Totals Coverage Status
Change from base Build 6223968310: 0.008%
Covered Lines: 6035
Relevant Lines: 11768

💛 - Coveralls

@domna
Copy link
Collaborator
domna commented Oct 25, 2023

We should also add the standard NXroot attributes here:

  • file_time
  • file_name
  • file_update_time
  • NeXus_version (related to Add versioning for nexus_definitions #162, so we should maybe add it there)
  • HDF_version
  • HDF5_Version
  • XML_version
  • h5py_version
  • [X] creator (We actually have something in entry for NXmpes - maybe we leave this out as this is not pynxtools specific?)
  • [X] creator_version

See here for full reference

@sherjeelshabih
Copy link
Collaborator Author
  • file_time
  • file_name
  • file_update_time
  • HDF5_Version
  • h5py_version

I'll add NeXus_version once you're stable with #162

These don't work for us. The first is the hdf4 version. And we don't write any XML here.

  • HDF_version
  • XML_version

@domna
Copy link
Collaborator
domna commented Oct 26, 2023

This works fine for me, however I get undocumented field warnings when I execute this on my example files:

❯ dataconverter --reader mpes --nxdl NXmpes --input-file MoTe2.h5 --input-file config_file.json --output MoTe2.mpes.nxs --undocumented
Using mpes reader to convert the given files:  
• MoTe2.h5
• config_file.json 
The path, /@NX_class, is being written but has no documentation.
The path, /@file_name, is being written but has no documentation.
The path, /@file_time, is being written but has no documentation.
The path, /@file_update_time, is being written but has no documentation.
The path, /@NeXus_version, is being written but has no documentation.
The path, /@HDF5_version, is being written but has no documentation.
The path, /@h5py_version, is being written but has no documentation.
The output file generated: MoTe2.mpes.nxs

Interestingly, I don't get an undocumented warning for @partial if I add it to NXroot...

@sherjeelshabih
Copy link
Collaborator Author

This works fine for me, however I get undocumented field warnings when I execute this on my example files:

❯ dataconverter --reader mpes --nxdl NXmpes --input-file MoTe2.h5 --input-file config_file.json --output MoTe2.mpes.nxs --undocumented
Using mpes reader to convert the given files:  
• MoTe2.h5
• config_file.json 
The path, /@NX_class, is being written but has no documentation.
The path, /@file_name, is being written but has no documentation.
The path, /@file_time, is being written but has no documentation.
The path, /@file_update_time, is being written but has no documentation.
The path, /@NeXus_version, is being written but has no documentation.
The path, /@HDF5_version, is being written but has no documentation.
The path, /@h5py_version, is being written but has no documentation.
The output file generated: MoTe2.mpes.nxs

Interestingly, I don't get an undocumented warning for @partial if I add it to NXroot...

The NXroot objects are not added during Template generation. This means when I add them, they get added to the undocumented part of the Template. I don't want to re-run them and figure out their validity. It's too expensive. Here, we know that the code is producing them correctly anyways. So I just skip over those checks.

Now, you won't get the undocumented warnings.

Copy link
Collaborator
@domna domna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfect now :)
I can also add the NeXus_version attribute in #162 if you want to merge this already.

@sherjeelshabih sherjeelshabih merged commit 8ba8376 into master Oct 27, 2023
@sherjeelshabih sherjeelshabih deleted the 163-write-nxroot-attributes branch October 27, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write NXroot attributes
3 participants
0