Repository navigation
Handle default units in early schema versions (#1468) - #1469
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
🟢 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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.