Skip to content

First stage in fixing inLibrary attribute for schema extras#1340

Open
VisLab wants to merge 7 commits into
hed-standard:mainfrom
VisLab:fix_links
Open

First stage in fixing inLibrary attribute for schema extras#1340
VisLab wants to merge 7 commits into
hed-standard:mainfrom
VisLab:fix_links

Conversation

@VisLab

@VisLab VisLab commented Jun 26, 2026

Copy link
Copy Markdown
Member

No description provided.

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.

Pull request overview

This PR is the first step toward correctly tracking the inLibrary / in_library origin for schema “extras” (Sources/Prefixes/External annotations) when working with partnered library schemas, and updates the test fixtures to reflect merged library schemas.

Changes:

  • Add in_library tagging/merge behavior when loading extras from XML/MediaWiki/JSON/DataFrame inputs, and adjust serializers to use a merged-extras accessor.
  • Update merged-schema serialization paths to better control whether base-standard extras are included, and ensure in_library metadata is not serialized.
  • Refresh schema test fixtures (TSV/XML/MediaWiki) and a few tests to reflect merged library schema state and newly required extras sections.

Reviewed changes

Copilot reviewed 32 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/schema/test_schema_extras_comprehensive.py Adjusts expectation for merged test schemas (schema.merged).
tests/schema/test_schema_compliance.py Modifies dc:source compliance test (currently includes debug I/O and removed assertion).
tests/schema/test_hed_schema_io.py Updates prerelease library fixture name/library (testliba).
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_ValueClass.tsv Expands value class fixtures for merged test library schema.
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_UnitModifier.tsv Adds SI unit modifier fixtures.
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_UnitClass.tsv Adds unit class fixtures.
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_Unit.tsv Adds unit fixtures and relationships to unit classes.
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_Tag.tsv Rebuilds merged tag TSV (including inLibrary=testlib markings for library-origin tags).
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_Structure.tsv Updates header structure (removes unmerged="True" in fixture).
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_ObjectProperty.tsv Adds object-property fixtures.
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_DataProperty.tsv Adds data-property fixtures (including inLibrary definition).
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_AttributeProperty.tsv Adds attribute-property fixtures.
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_AnnotationProperty.tsv Expands annotation-property fixtures.
tests/data/schema_tests/prerelease/HED9.9.9.mediawiki Adds extras section headers required for parsing (Sources/External annotations).
tests/data/schema_tests/prerelease/HED_testpre_1.0.0.mediawiki Adds Prefixes section header required for parsing.
tests/data/schema_tests/prerelease/HED_testliba_2.1.0.xml Renames prerelease library fixture and updates withStandard.
tests/data/schema_tests/HED_testlib_2.1.0.xml Adds a non-prerelease XML library schema fixture including extras sections.
hed/scripts/check_schema_loading.py Adds support for testing additional flat schema directories + CLI flag to exclude them.
hed/schema/schema_io/xml2schema.py Adds in_library column tagging for extras when loading library schemas (XML).
hed/schema/schema_io/wiki2schema.py Adds in_library column tagging for extras when loading library schemas (MediaWiki).
hed/schema/schema_io/schema2xml.py Switches extras output to use merged-extras accessor.
hed/schema/schema_io/schema2wiki.py Switches extras output to use merged-extras accessor and skips in_library when serializing.
hed/schema/schema_io/schema2json.py Switches extras output to use merged-extras accessor.
hed/schema/schema_io/schema2df.py Updates DataFrame serializer extras output; ensures in_library is stripped from serialized extras.
hed/schema/schema_io/schema2base.py Adds base-schema loading + merged-extras helper to support merged output behavior.
hed/schema/schema_io/json2schema.py Adds in_library column tagging for extras when loading library schemas (JSON).
hed/schema/schema_io/df2schema.py Adds in_library column tagging for extras when loading from DataFrames.
hed/schema/schema_io/df_util.py Updates extras merge logic to prefer library rows for duplicates (and keeps in_library for comparison semantics).
hed/schema/schema_io/base2schema.py Strips in_library column during normalization to avoid serializing internal metadata.
hed/schema/hed_schema.py Adjusts save_as_dataframes behavior to preserve serializer-merged extras when saving merged output and strip in_library when appropriate.
.github/copilot-instructions.md Updates contributor guidance on placing temporary files in .status/.

Comment thread tests/schema/test_schema_compliance.py Outdated
Comment thread hed/schema/schema_io/df_util.py Outdated
Comment thread hed/schema/schema_io/schema2base.py Outdated
Comment thread hed/scripts/check_schema_loading.py Outdated

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.

Pull request overview

Copilot reviewed 34 out of 38 changed files in this pull request and generated 2 comments.

Comment thread tests/data/schema_tests/prerelease/HED_testpre_1.0.1.mediawiki Outdated
Comment thread tests/schema/test_hed_schema_io.py Outdated

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.

Pull request overview

Copilot reviewed 34 out of 38 changed files in this pull request and generated 2 comments.

Comment thread hed/schema/schema_io/df_util.py Outdated
Comment thread tests/schema/test_hed_schema_io.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants