From 3e2770c7f49493d26d0254df46785ce124463514 Mon Sep 17 00:00:00 2001 From: IanCa Date: Wed, 29 Nov 2023 18:40:41 -0600 Subject: [PATCH] Fix bug and spelling --- hed/models/hed_tag.py | 2 +- hed/validator/def_validator.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hed/models/hed_tag.py b/hed/models/hed_tag.py index 12577b36..bdbfa852 100644 --- a/hed/models/hed_tag.py +++ b/hed/models/hed_tag.py @@ -320,7 +320,7 @@ def get_stripped_unit_value(self, extension_text): """ Return the extension divided into value and units, if the units are valid. Parameters: - extension_text (str): The text to split, incase it's a portion of a tag. + extension_text (str): The text to split, in case it's a portion of a tag. Returns: stripped_unit_value (str): The extension portion with the units removed. diff --git a/hed/validator/def_validator.py b/hed/validator/def_validator.py index 8ca30022..13fcfa5f 100644 --- a/hed/validator/def_validator.py +++ b/hed/validator/def_validator.py @@ -127,6 +127,9 @@ def validate_def_value_units(self, def_tag, hed_validator): def_contents = def_entry.get_definition(def_tag, placeholder_value=placeholder, return_copy_of_tag=True) if def_contents and def_entry.takes_value and hed_validator: placeholder_tag = def_contents.get_first_group().find_placeholder_tag() + # Handle the case where they're adding a unit as part of a placeholder. eg Speed/# mph + if placeholder_tag: + placeholder = placeholder_tag.extension def_issues += hed_validator.validate_units(placeholder_tag, placeholder, report_as=def_tag,