From 9b4110a92c05654e6c61d37b1169a93c08b5b54f Mon Sep 17 00:00:00 2001 From: IanCa Date: Mon, 26 Feb 2024 16:00:45 -0600 Subject: [PATCH] Only flag spaces in units if they aren't deprecated --- hed/schema/schema_compliance.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hed/schema/schema_compliance.py b/hed/schema/schema_compliance.py index 87f2bc00..d5ca8d03 100644 --- a/hed/schema/schema_compliance.py +++ b/hed/schema/schema_compliance.py @@ -126,10 +126,13 @@ def check_invalid_chars(self): issues_list += validate_schema_description(tag_name, desc) if schema_version_greater_equal(self.hed_schema, "8.3.0"): - for unit in self.hed_schema.units: - for i, char in enumerate(unit): + for unit_name, unit in self.hed_schema.units.items(): + # Don't check for spaces on deprecated units, to avoid degree Celsius issue + if unit.has_attribute(HedKey.DeprecatedFrom): + continue + for i, char in enumerate(unit_name): if char == " ": issues_list += ErrorHandler.format_error(SchemaWarnings.SCHEMA_INVALID_CHARACTERS_IN_TAG, - unit, char_index=i, problem_char=char) + unit_name, char_index=i, problem_char=char) return issues_list