Testing for generating template from NeXusTree#620
Draft
RubelMozumder wants to merge 2 commits intomasterfrom
Draft
Testing for generating template from NeXusTree#620RubelMozumder wants to merge 2 commits intomasterfrom
RubelMozumder wants to merge 2 commits intomasterfrom
Conversation
RubelMozumder
commented
Apr 9, 2025
Comment on lines
+1
to
+14
| from pynxtools.dataconverter.helpers import generate_template_from_nxdl | ||
| from pynxtools.dataconverter.nexus_tree import * | ||
| from pynxtools.dataconverter.template import Template | ||
|
|
||
| spm_appdef = "NXspm" | ||
| spmT = generate_tree_from(spm_appdef) | ||
|
|
||
|
|
||
| def add_template_key_from(nx_node, | ||
| parent_path = ""): | ||
| key = None | ||
| unit = None | ||
| if nx_node.type == "attribute": | ||
| leaf_part = (f"{nx_node.name}[{nx_node.name}]" |
Collaborator
Author
There was a problem hiding this comment.
Delete this file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the current implementation how the Template instance is populated, not all the inheritance fields can be resolved specially some fields from inheritance chain are missing. Taking leverage from NeXus tree would be a good option for that.
Beside that, the template only stores the path of the nexus concept path as a plain string. And in the reader plugin, the reader developer somehow needs to check the proper type of the data, and most of the time, the information of the data type or unit type for a field or attribute is noted in reader plugin manually. Which is error prone and needs extra effort. This PR is intended to handle.
data type,unit type,nameTypeinfo which will be carry exact information as an nxdl node contains. This method would justifynxdlas a single source of truth.