Skip to content

Commit dac5220

Browse files
authored
Merge pull request hed-standard#875 from IanCa/develop
Only flag spaces in units if they aren't deprecated
2 parents 59a0e9f + 9b4110a commit dac5220

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

hed/schema/schema_compliance.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,13 @@ def check_invalid_chars(self):
126126
issues_list += validate_schema_description(tag_name, desc)
127127

128128
if schema_version_greater_equal(self.hed_schema, "8.3.0"):
129-
for unit in self.hed_schema.units:
130-
for i, char in enumerate(unit):
129+
for unit_name, unit in self.hed_schema.units.items():
130+
# Don't check for spaces on deprecated units, to avoid degree Celsius issue
131+
if unit.has_attribute(HedKey.DeprecatedFrom):
132+
continue
133+
for i, char in enumerate(unit_name):
131134
if char == " ":
132135
issues_list += ErrorHandler.format_error(SchemaWarnings.SCHEMA_INVALID_CHARACTERS_IN_TAG,
133-
unit, char_index=i, problem_char=char)
136+
unit_name, char_index=i, problem_char=char)
134137

135138
return issues_list

0 commit comments

Comments
 (0)