-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding nexus in ref #150
Adding nexus in ref #150
Conversation
hdf5 link, parsing nexis, with error.
Reviewer's Guide by SourceryThis pull request implements NeXus support for XRD measurements. It introduces a new schema for storing NeXus references and populates it during normalization. Additionally, it includes functions to traverse archive data, map archive data to NeXus, and write NeXus files. Sequence diagram for NeXus file generation processsequenceDiagram
participant Archive
participant HDF5Handler
participant Template
participant Writer
Archive->>HDF5Handler: write_nx_file()
HDF5Handler->>Template: generate_template_from_nxdl()
HDF5Handler->>HDF5Handler: populate_nx_dataset_and_attribute()
loop For each dataset
HDF5Handler->>Template: Add dataset to template
end
loop For each attribute
HDF5Handler->>Template: Add attribute to template
end
HDF5Handler->>Writer: write(template)
Writer-->>HDF5Handler: Return success
HDF5Handler->>Archive: Update reference
Class diagram for NeXus implementationclassDiagram
class ELNXRayDiffraction {
+nexus_results: ArchiveSection
+normalize(archive, logger)
+get_read_write_functions()
}
class HDF5Handler {
+write_nx_file()
-_write_hdf5_file()
-_remove_nexus_annotations()
}
class DatasetModel {
+data: Any
}
ELNXRayDiffraction --> HDF5Handler
HDF5Handler --> DatasetModel
note for ELNXRayDiffraction "Added nexus_results field"
note for HDF5Handler "Implemented NeXus file generation"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @RubelMozumder - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/nomad_measurements/utils.py
Outdated
if not entry_list: | ||
self.archive.m_context.process_updated_raw_file(self.data_file) | ||
|
||
except NXFileGenerationError as exc: |
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.
issue (bug_risk): Error handling could mask original exception when cleanup fails
Consider handling file deletion errors separately to preserve the original exception context and ensure proper cleanup.
40cab76
to
ae97d7c
Compare
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.
Looks great!
Implement Nexus file generation for XRD measurements.
PR #116 handled in #118 and #150.