8000 Use quantity name directly by TLCFEM · Pull Request #437 · FAIRmat-NFDI/pynxtools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use quantity name directly #437

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 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions src/pynxtools/nomad/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _populate_data(
"setting attribute attempt before creating quantity"
)
current.m_set_quantity_attribute(
metainfo_def, attr_name, attr_value, quantity=quantity
quantity.name, attr_name, attr_value
)
except Exception as e:
self._logger.warning(
Expand Down Expand Up @@ -308,26 +308,26 @@ def _populate_data(
try:
current.m_set(metainfo_def, field)
current.m_set_quantity_attribute(
metainfo_def, "m_nx_data_path", hdf_node.name, quantity=field
data_instance_name, "m_nx_data_path", hdf_node.name
)
current.m_set_quantity_attribute(
metainfo_def, "m_nx_data_file", self.nxs_fname, quantity=field
data_instance_name, "m_nx_data_file", self.nxs_fname
)
if field_stats is not None:
# TODO _add_additional_attributes function has created these nx_data_*
# attributes speculatively already so if the field_stats is None
# this will cause unpopulated attributes in the GUI
current.m_set_quantity_attribute(
metainfo_def, "nx_data_mean", field_stats[0], quantity=field
data_instance_name, "nx_data_mean", field_stats[0]
)
current.m_set_quantity_attribute(
metainfo_def, "nx_data_var", field_stats[1], quantity=field
data_instance_name, "nx_data_var", field_stats[1]
)
current.m_set_quantity_attribute(
metainfo_def, "nx_data_min", field_stats[2], quantity=field
data_instance_name, "nx_data_min", field_stats[2]
)
current.m_set_quantity_attribute(
metainfo_def, "nx_data_max", field_stats[3], quantity=field
data_instance_name, "nx_data_max", field_stats[3]
)
except Exception as e:
self._logger.warning(
Expand Down
Loading
0