Skip to content

Commit 6d28203

Browse files
committed
dont check not visted keys where the value is None
1 parent b815c20 commit 6d28203

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/pynxtools/dataconverter/validation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,6 @@ def handle_group(node: NexusGroup, keys: Mapping[str, Any], prev_path: str):
482482
and node.optionality == "required"
483483
and node.type in missing_type_err
484484
):
485-
# Remove any subkeys from further checking.
486-
for key in mapping:
487-
if key.startswith(f"{prev_path}/{node.name}"):
488-
remove_from_not_visited(key)
489485
collector.collect_and_log(
490486
f"{prev_path}/{node.name}",
491487
missing_type_err.get(node.type),
@@ -1366,6 +1362,10 @@ def check_reserved_prefix(
13661362
check_attributes_of_nonexisting_field(tree)
13671363

13681364
for not_visited_key in not_visited:
1365+
if mapping.get(not_visited_key) is None:
1366+
# This value is not really set. Skip checking its validity.
1367+
continue
1368+
13691369
# TODO: remove again if "@target"/"@reference" is sorted out by NIAC
13701370
always_allowed_attributes = ("@target", "@reference")
13711371
if not_visited_key.endswith(always_allowed_attributes):

src/pynxtools/units/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class NXUnitSet:
4242
"NX_ANY": None,
4343
"NX_AREA": "[area]",
4444
"NX_CHARGE": "[charge]",
45-
"NX_COUNT": "[count]",
45+
"NX_COUNT": "1",
4646
"NX_CROSS_SECTION": "[area]",
4747
"NX_CURRENT": "[current]",
4848
"NX_DIMENSIONLESS": "1",

0 commit comments

Comments
 (0)