Skip to content

Commit

Permalink
Properly deal with undocumented @Units as discussed w/ @sherjeelshabih
Browse files Browse the repository at this point in the history
  • Loading branch information
domna committed Jan 19, 2024
1 parent 116f099 commit 279ba0e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pynxtools/dataconverter/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,15 @@ def try_undocumented(data, nxdl_root: ET.Element):
nxdl_path = convert_data_converter_dict_to_nxdl_path(path)

if entry_name == "@units":
if (
path.rsplit("/", 1)[0] in data.get_documented()
and path in data.undocumented
):
field_path = path.rsplit("/", 1)[0]
if field_path in data.get_documented() and path in data.undocumented:
field_requiredness = get_required_string(
nexus.get_node_at_nxdl_path(
nxdl_path=convert_data_converter_dict_to_nxdl_path(field_path),
elem=nxdl_root,
)
)
data[field_requiredness][path] = data.undocumented[path]
del data.undocumented[path]
continue

Expand Down

0 comments on commit 279ba0e

Please sign in to comment.