Skip to content

Commit

Permalink
Merge pull request #875 from IanCa/develop
Browse files Browse the repository at this point in the history
Only flag spaces in units if they aren't deprecated
  • Loading branch information
VisLab authored Feb 26, 2024
2 parents 59a0e9f + 9b4110a commit dac5220
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hed/schema/schema_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dac5220

Please sign in to comment.