-
Notifications
You must be signed in to change notification settings - Fork 8
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
Nexus file parsing refactoring #303
base: master
Are you sure you want to change the base?
Conversation
nx_name=get_nxdl_entry(hdf_info), | ||
hdf_node=hdf_node, | ||
hdf_path=hdf_info["hdf_path"] if "hdf_path" in hdf_info else None, | ||
hdf_root=hdf_info["hdf_root"] if "hdf_root" in hdf_info else None, | ||
) | ||
# Copy the nxdl_path, otherwise the cached object is altered | ||
nxdl_path = nxdl_path.copy() |
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.
also covert by another PR
self.input_file_name = ( | ||
nexus_file | ||
if nexus_file is not None | ||
else os.path.join(local_dir, "../../tests/data/nexus/201805_WSe2_arpes.nxs") |
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.
default option is to run it as an example on the provided test file
|
||
def visit_node(self, hdf_name, hdf_node): | ||
"""Function called by h5py that iterates on each node of hdf5file. | ||
It allows h5py visititems function to visit nodes.""" | ||
if self.d_inq_nd is None and self.c_inq_nd is None: | ||
process_node(hdf_node, "/" + hdf_name, self.parser, self.logger) |
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.
default option is to annotate the whole file
A general note on the code: It is really hard to understand what is happening in this code part and I'm not sure whether there are other problems because it's hard to get a general overview. I have a few recommendations on general refactoring: