From 755a2c14a7553e11e8d17b01ceb8f8840e7c637b Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Tue, 5 Nov 2024 15:56:30 +0100 Subject: [PATCH] fix: apply to groups and datasets --- src/chexus/validators.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/chexus/validators.py b/src/chexus/validators.py index 1da8d5a..96c4f22 100644 --- a/src/chexus/validators.py +++ b/src/chexus/validators.py @@ -200,11 +200,7 @@ def __init__(self) -> None: ) def applies_to(self, node: Dataset | Group) -> bool: - return ( - isinstance(node, Dataset) - and is_transformation(node) - and "offset" in node.attrs - ) + return is_transformation(node) and "offset" in node.attrs def validate(self, node: Dataset | Group) -> Violation | None: if "offset_units" not in node.attrs: @@ -219,11 +215,7 @@ def __init__(self) -> None: ) def applies_to(self, node: Dataset | Group) -> bool: - return ( - isinstance(node, Dataset) - and is_transformation(node) - and "offset_units" in node.attrs - ) + return is_transformation(node) and "offset_units" in node.attrs def validate(self, node: Dataset | Group) -> Violation | None: import scipp as sc