Skip to content

Handle default units in early schema versions (#1468) - #1469

Merged
VisLab merged 4 commits into
hed-standard:mainfrom
VisLab:handle_default_units
Oct 18, 2026
Merged

VisLab merged 4 commits into
hed-standard:mainfrom
VisLab:handle_default_units

Conversation

@VisLab

@VisLab VisLab commented Oct 17, 2026

Copy link
Copy Markdown
Member

No description provided.

VisLab and others added 2 commits October 17, 2026 16:36
Three tests in TestDefaultUnit800, test-only: weightUnits (SI default g:
g, gram, grams convert as 1; pound and kg do not), speedUnits (compound
default m-per-s: m-per-s and no unit convert; km-per-s does not), and
intensityUnits (default dB is not SI while candela and cd are: dB converts,
candela and cd do not), the last built from the bundled HED8.0.0.xml with
one tag's placeholder given unitClass=intensityUnits, since no 8.0.0 tag
uses that class. The intensityUnits case is the one that detects the
default-unit SI guard being removed; the Weight cases cannot, because g is
itself SI.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Both files are byte-identical to hed-schemas main (cd79695):
library_schemas/lang/hedxml/HED_lang_1.2.0.xml and
library_schemas/score/hedxml/HED_score_1.2.0.xml. They are listed by
get_hed_versions, load with their standard partners (8.5.0 and 8.2.0) and
pass compliance. library_data.json already matched.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@VisLab VisLab added bug Something isn't working python Pull requests that update Python code testing schema-handling labels Oct 17, 2026
@VisLab
VisLab requested a balanced review from Copilot October 17, 2026 23:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused test additions have no identified blocking issues; tests were not executed.

No open issues 🎉

What changed in this PR

Adds regression coverage for default-unit conversion in early HED schemas.

Changes:

  • Tests SI, compound, and non-SI default units.
  • Checks that unsupported conversions return None.
  • Adds a shared conversion helper.
File Description
tests/​validator/​test_reserved_checker.py Adds weight, speed, and intensity unit-conversion tests.

Review effort: Balanced

VisLab and others added 2 commits October 18, 2026 07:57
spec_tests/test_hed_cache.py guarded on score 1.2.0 being unbundled so
get_hed_version_path had to download it; 224413d bundled it, and no
released lang or score version is left out of hed/schema/schema_data/.
The test now copies the bundle without HED_score_1.2.0.xml and points
hed_cache.INSTALLED_CACHE_LOCATION at the copy for its duration, so it
keeps exercising the single-file download whatever hedtools ships. The
download assertions are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The eight partnered library files in hed/schema/schema_data/ (lang 1.0.0
to 1.2.0, score 1.1.0 to 2.2.0) are now the unmerged XML from hed-schemas
schemas_xml_unmerged/ at bdc88ee, 7.3 MB down to 2.4 MB. HED_score_1.0.0
is unpartnered and stays the full release; the six standard files are
the GitHub releases, byte for byte. load_schema_version gives a schema
equal to the merged release for every one of the eight, with the partner
taken from the bundled standard schema; the user cache is seeded from the
bundle only for names it lacks, so an existing cache keeps its merged
copies and loads the same.

Tests: unit suite 1681 OK with the user cache redirected to an empty
directory (every schema from the bundle); python -m unittest discover
spec_tests 22 OK.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review identified no blocking issues in the tests or bundled-schema addition; project tests were not run.

No open issues 🎉

Review effort: Balanced

@VisLab
VisLab merged commit b3483b9 into hed-standard:main Oct 18, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update Python code schema-handling testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants