Skip to content

Flag described unit class redeclarations - #1460

Merged
VisLab merged 1 commit into
hed-standard:mainfrom
VisLab:minor_fixes
Oct 13, 2026
Merged

VisLab merged 1 commit into
hed-standard:mainfrom
VisLab:minor_fixes

Conversation

@VisLab

@VisLab VisLab commented Oct 13, 2026

Copy link
Copy Markdown
Member

An unmerged partnered library may name a partner unit class bare to add units to it. A redeclaration carrying a description was also taken for that form: it was left out of duplicate_names, so the merged schema held an empty second copy of the class and check_compliance reported nothing. The add-units form now also requires an empty description, so such a redeclaration is reported as SCHEMA_LIBRARY_INVALID like one with attributes (spec Appendix B, SCHEMA_LIBRARY_INVALID i).

Fixes #1434

An unmerged partnered library may name a partner unit class bare to add
units to it. A redeclaration carrying a description was also taken for
that form: it was left out of duplicate_names, so the merged schema held
an empty second copy of the class and check_compliance reported nothing.
The add-units form now also requires an empty description, so such a
redeclaration is reported as SCHEMA_LIBRARY_INVALID like one with
attributes (spec Appendix B, SCHEMA_LIBRARY_INVALID i).

Fixes hed-standard#1434

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 fix correctly addresses the duplicate-detection gap and includes representative regression coverage.

0 open findings

What changed in this PR

Fixes partner unit-class redeclarations with descriptions being incorrectly treated as valid unit-only extensions.

Changes:

  • Requires unit-class placeholders to have no description.
  • Adds regression tests for bare, described, and attributed redeclarations.
File Description
hed/​schema/​hed_schema_section.py Marks described unit-class redeclarations as duplicates.
tests/​schema/​test_schema_merge.py Tests valid placeholders and invalid redeclarations.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@VisLab
VisLab merged commit a8a08da into hed-standard:main Oct 13, 2026
18 checks passed
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.

A library that redeclares a partner unit class with a description gets two entries and no error

2 participants