Cache rework to better use hed-schemas version manifest#1360
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reworks HED schema caching/version discovery to use a repo-level schema_versions.json manifest from hed-schemas as a fast path, reducing GitHub REST API crawling and enabling single-version on-demand downloads.
Changes:
- Add
hed.schema.schema_version_manifestto parse a global version manifest and build raw download URLs pinned to a specific repo commit. - Update
hed.schema.hed_cacheto (a) use the manifest fast path inget_available_hed_versions, (b) seed caches with bundled schemas before attempting network downloads, and (c) download only a requested schema version on-demand. - Expand unit/spec tests to cover manifest parsing, fallback behaviors, and single-version download behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
hed/schema/schema_version_manifest.py |
New manifest parsing helpers for listing versions and locating per-version download metadata. |
hed/schema/hed_cache.py |
Integrates manifest fast path, improves cache seeding robustness, and adds single-version download helper. |
tests/schema/test_schema_version_manifest.py |
New unit tests for manifest parsing behaviors (no I/O). |
tests/schema/test_hed_schema_io.py |
Adds regression tests for fallback behavior and ensures manifest URL is treated as library-neutral in caching tests. |
spec_tests/test_hed_cache.py |
Updates spec test to verify on-demand downloading of a non-bundled library schema version. |
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.