diff --git a/src/chexus/validators.py b/src/chexus/validators.py index f76ed9f..ca71b85 100644 --- a/src/chexus/validators.py +++ b/src/chexus/validators.py @@ -479,7 +479,7 @@ def applies_to(self, node: Dataset | Group) -> bool: return ( isinstance(node, Dataset) and node.parent.attrs.get("NX_class") == "NXevent_data" - and node.name == 'event_index' + and node.name.rpartition('/')[-1] == 'event_index' ) def validate(self, node: Dataset | Group) -> Violation | None: diff --git a/tests/validators_test.py b/tests/validators_test.py index 8cfe612..1c75b41 100644 --- a/tests/validators_test.py +++ b/tests/validators_test.py @@ -803,14 +803,14 @@ def test_NXdetector_pixel_offsets_are_unambiguous_2d_ids_allow_axis_attr() -> No def test_event_index_is_eight_bytes() -> None: parent = chexus.Group(name="event_data", attrs={"NX_class": "NXevent_data"}) good = chexus.Dataset( - name='event_index', + name='event_data/event_index', value=[1, 2, 3], shape=(3,), dtype='int64', parent=parent, ) bad = chexus.Dataset( - name='event_index', + name='event_data/event_index', value=[1, 2, 3], shape=(3,), dtype='int32',