Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for library schemas #75

Merged
merged 120 commits into from
Aug 29, 2022
Merged

Implement support for library schemas #75

merged 120 commits into from
Aug 29, 2022

Conversation

happy5214
Copy link
Member

This PR will eventually contain support for validation using library schemas.

@happy5214 happy5214 added enhancement New feature or request bids BIDS integration hed 3 HED 3-specific issues validation Tag validation issues schema Schema parsing parsing String parsing labels Jun 7, 2022
@happy5214 happy5214 added this to the Library Schemas milestone Jun 7, 2022
@happy5214 happy5214 self-assigned this Jun 7, 2022
@happy5214
Copy link
Member Author

I did a quick local test by running the HED-3G schema parsing tests using the testlib library schema instead of the base schema, and they all passed, confirming that at least that library schema is parsed correctly.

Also re-enable existing test for loading remote library schemas.
This commit adds the necessary code to parse library schema nicknames
from HED tags and pass them to ParsedHedTag objects. It also adds the
unmatchedLibrarySchema issue for cases when a schema cannot be found.

The internal converter functions have been modified to accept Schema
objects instead of Schemas objects, and the public-facing ones
(which were not changed for BC reasons) have been deprecated from the
public API and will be made private in version 4.0.0 due to a lack of
independent utility.

A minor issue in the new schema loading code was also fixed, bringing
it in line with the surrounding code, and some documentation was fixed.

None of this code has been tested with tags using library schemas. Tests
will be added in the next commit.
Also add minor documentation and code quality changes.
happy5214 added 15 commits June 15, 2022 11:16
Such a failure is caused by the validator itself and is unrelated to
the BIDS dataset, so it doesn't make sense to tie it with any BIDS
dataset files.
This commit moves the value validation checks to the generation-specific
classes. It also adds a utility property for the formatted takes-value
tag on a ParsedHedTag.

The tests currently fail due to an issue with Definition tags with
placeholders not generating a takesValueTag in the ParsedHed3Tag object,
thus leading to an undefined-pointer error. I don't have a good solution
at this time.
 - Use ParsedHedSubstring for unparsed tag groups.
 - Fix colon bug.
 - Fix takesValue tag bug.
Most of the tests pass, but some fail.
Also surround schema loading tests in describe block.
happy5214 and others added 27 commits August 25, 2022 05:27
Also use Set for fallback schema list.
Restructured tests for library schema with Defs
This will prevent an edge case of any accidental string interpolation.
@happy5214 happy5214 marked this pull request as ready for review August 29, 2022 10:36
@happy5214 happy5214 merged commit e579f8d into master Aug 29, 2022
@happy5214 happy5214 deleted the library-schemas branch August 29, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bids BIDS integration enhancement New feature or request hed 3 HED 3-specific issues parsing String parsing schema Schema parsing validation Tag validation issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement support for library schemas
2 participants