Skip to content
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

Use hdf5 or nexus file in XRD #113

Open
wants to merge 85 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
03f9668
updated plugin structure
andreaa93 Aug 19, 2024
4cd5876
added pynxtools dependency
andreaa93 Aug 19, 2024
cf8477a
Apply suggestions from Sarthak's code review
andreaa93 Aug 20, 2024
20f671e
ruff linting
andreaa93 Aug 20, 2024
7ebc02b
Ruff linting 2
ka-sarthak Aug 20, 2024
0267e34
Apply suggestions from code review
andreaa93 Aug 20, 2024
8023fd1
changed xrd parser folder
andreaa93 Aug 21, 2024
326ff9e
last fixes and descriptions
andreaa93 Aug 21, 2024
7020e31
description of general schema
andreaa93 Aug 21, 2024
cc08ba9
changed general package into a module
andreaa93 Aug 21, 2024
8de59ec
Implement write nexus section based on the populated nomad archive
ka-sarthak Jun 11, 2024
e687c46
Update path of populate_nexus_subsection
ka-sarthak Aug 27, 2024
e618170
app def missing. (#108)
RubelMozumder Aug 28, 2024
f0828ca
Run Python test action for all PR
ka-sarthak Aug 29, 2024
8db4370
Fix for rebasing issues
ka-sarthak Sep 3, 2024
f5fda0f
Use hdf5 references for arrays (#118)
ka-sarthak Jan 14, 2025
75bb246
Adding nexus in ref (#150)
RubelMozumder Dec 20, 2024
1ef1c1b
Move common functionality to resolve_path
ka-sarthak Dec 20, 2024
5b2a4f7
Allow reading with dataset_path alone
ka-sarthak Jan 7, 2025
5dc681c
Allow reading with archive paths
ka-sarthak Jan 14, 2025
680edb0
Never reset the instance variables
ka-sarthak Jan 14, 2025
9f43379
Final file writing when the instance is deleted
ka-sarthak Jan 14, 2025
76452ec
Reduce write_file calls to one
ka-sarthak Jan 14, 2025
94baa75
Fix: set hard links for internal ref
ka-sarthak Jan 15, 2025
4c4d29a
remove del method; fix test
ka-sarthak Jan 15, 2025
618fd77
Combine nexus dataset map
ka-sarthak Jan 16, 2025
63c4926
Ruff
ka-sarthak Jan 16, 2025
a59f532
Make Auxiliary file name without raw file ext
ka-sarthak Jan 16, 2025
13b3053
Add cleanup extensions for fixture
ka-sarthak Jan 16, 2025
f7bfd8f
Use bool in ELN to control raw file updation
ka-sarthak Jan 16, 2025
a88006a
Remove 'file and entry deletion'
ka-sarthak Jan 20, 2025
9e39be7
remove defaults: trigger write if file is missing
ka-sarthak Jan 20, 2025
a7b8e07
Minor
ka-sarthak Jan 20, 2025
ff15839
Set hdf5 references at add_dataset stage
ka-sarthak Jan 21, 2025
9cddee0
Reset on trigger for main branch PR only
ka-sarthak Jan 21, 2025
ad9217c
abstract out set hdf5 ref
ka-sarthak Jan 23, 2025
13e88ee
Comment out nexus, TODOs, docstrings
ka-sarthak Jan 23, 2025
7105d0a
Reprocess nxs entry
ka-sarthak Jan 23, 2025
3825e2c
Handle missing dataset in add step
ka-sarthak Jan 23, 2025
de3bd3f
Comment out import
ka-sarthak Jan 23, 2025
0c025dc
Review: sourcery
ka-sarthak Jan 24, 2025
52d720b
Add back non hdf5 result sections
ka-sarthak Jan 31, 2025
196291f
reset quantity shape
ka-sarthak Jan 31, 2025
dfc1510
Remove redundant definitions; add overwritten and new ones
ka-sarthak Jan 31, 2025
e63ed6d
Minor
ka-sarthak Jan 31, 2025
be3e5dc
Hide array_index
ka-sarthak Jan 31, 2025
6c5fc5e
Update class in test
ka-sarthak Jan 31, 2025
e9a5ded
Make it optional to supply additional clean up extensions
ka-sarthak Jan 31, 2025
5d5d586
Review: harmonize filename
ka-sarthak Feb 5, 2025
284fd38
Fix
ka-sarthak Feb 6, 2025
48a14f2
fix pynxtools version and a minor fix in nexus part.
RubelMozumder Feb 6, 2025
4bbdeef
Review: Rename plotting sections
ka-sarthak Feb 6, 2025
230dc18
Review: use Dataset model as argument
ka-sarthak Feb 6, 2025
0f0809b
Review: remove redundant variable
ka-sarthak Feb 6, 2025
8101848
Review: use dict comprehension
ka-sarthak Feb 7, 2025
7bf2792
Update doc strings
ka-sarthak Feb 7, 2025
68f9773
Make explicit nexus generation error flag
ka-sarthak Feb 7, 2025
d226f3c
Review: renaming
ka-sarthak Feb 7, 2025
01658bc
Take out hdf5 population from normalize to separate methods
ka-sarthak Feb 10, 2025
63c20ea
Move handler to XRayDiffraction
ka-sarthak Feb 10, 2025
e378796
Trigger hdf5 handling from XRayDiffraction
ka-sarthak Feb 10, 2025
21ffa42
Update doc for populate_nxdataset_and_attribute func.
RubelMozumder Feb 10, 2025
abd3577
Type hinting for datasets; docstring; ruff
ka-sarthak Feb 10, 2025
3c85c88
Use filename directly in read_dataset
ka-sarthak Feb 11, 2025
b4d29a9
Use handler as arg for generate plot
ka-sarthak Feb 11, 2025
fdb5639
Reordering
ka-sarthak Feb 11, 2025
2ccfca6
Fix
ka-sarthak Feb 11, 2025
ea2570e
Backcompatibility: delete results only if they has non-hdf5 definitions
ka-sarthak Feb 12, 2025
17e3cce
Docstrings
ka-sarthak Feb 12, 2025
893969c
Remove method: set_hdf5_reference
ka-sarthak Feb 12, 2025
dae1084
Make method private
ka-sarthak Feb 12, 2025
98d8fd2
Remove reading through archive path
ka-sarthak Feb 12, 2025
acc81da
Add dataset path normalization in read_dataset; minor
ka-sarthak Feb 12, 2025
b959cb1
Move all hdf5 related normalization in ELN normalization
ka-sarthak Feb 12, 2025
d2e78f4
Ordering
ka-sarthak Feb 12, 2025
550c834
Move results normalization to `XRayDiffraction`
ka-sarthak Feb 18, 2025
78fd0a2
Use None handler to slim down reprocessing
ka-sarthak Feb 18, 2025
940f907
Return early
ka-sarthak Feb 18, 2025
0b44419
Rename
ka-sarthak Feb 18, 2025
55ff442
Add browser adaptor
ka-sarthak Feb 18, 2025
bba0965
Revert pint as type checking import
ka-sarthak Feb 19, 2025
48c1006
Use nexus file
ka-sarthak Feb 21, 2025
d4ceb5c
Remove warnings from read_dataset; refactor
ka-sarthak Feb 21, 2025
e0166a7
Handle nexus filepath during tests
ka-sarthak Feb 21, 2025
e210a69
Ruff
ka-sarthak Feb 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reprocess nxs entry
ka-sarthak committed Jan 31, 2025
commit 7105d0acc3db05808d0f15ebae962efd9375a3a3
8 changes: 2 additions & 6 deletions src/nomad_measurements/utils.py
Original file line number Diff line number Diff line change
@@ -389,7 +389,6 @@ def _write_nx_file(self):
to the `hdf5_data_dict` before creating the nexus file. This provides a NeXus
view of the data in addition to storing array data.
"""
from nomad.processing.data import Entry

app_def = 'NXxrd_pan'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Get from nx map instead

nxdl_root, nxdl_f_path = get_nxdl_root_and_path(app_def)
@@ -430,12 +429,9 @@ def _write_nx_file(self):
pynxtools_writer(
data=template, nxdl_f_path=nxdl_f_path, output_path=nx_full_file_path
).write()

entry_list = Entry.objects(
upload_id=self.archive.m_context.upload_id, mainfile=self.data_file
self.archive.m_context.process_updated_raw_file(
self.data_file, allow_modify=True
)
if not entry_list:
self.archive.m_context.process_updated_raw_file(self.data_file)

def _write_hdf5_file(self): # noqa: PLR0912
"""