Minor refactoring of tests for efficiency#1226
Merged
VisLab merged 3 commits intohed-standard:mainfrom Feb 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors and expands the schema I/O test suite, consolidating prior converter/compliance coverage into broader roundtrip tests and adding targeted coverage around the inLibrary attribute across save modes and formats.
Changes:
- Added a dedicated
inLibraryattribute test module that exercises merged vs unmerged behavior across XML/JSON/MediaWiki/TSV and roundtrips. - Moved temp-file test helpers into a shared
schema_test_helpers.pymodule and updated imports accordingly; removed the oldertest_schema_converters.py. - Expanded
test_schema_format_roundtrip.pywith additional coverage (load-from-string, compliance, duplicates, prefix saving, edge-case roundtrips, prologue/epilogue preservation) and updated/extended test fixtures forHED_testlib_4.0.0.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/schema/test_schema_inlibrary_attribute.py | New cross-format tests validating inLibrary behavior under merged/unmerged saves and across roundtrips. |
| tests/schema/test_schema_format_roundtrip.py | Adds broader schema I/O tests (string loads, compliance/duplicates, prefix saving, edge-case roundtrips, prologue preservation). |
| tests/schema/test_schema_converters.py | Removes legacy converter/compliance tests that are now covered elsewhere. |
| tests/schema/test_hed_schema_io_df.py | Refactors line-ending tests into a helper and consolidates per-format checks. |
| tests/schema/test_hed_schema_io.py | Updates helper import to the new shared test helper module. |
| tests/schema/schema_test_helpers.py | Adds shared temp-file helper/decorator for schema tests. |
| tests/data/schema_tests/test_merge/HED_testlib_4.0.0* | Extends testlib fixture schema content across TSV/XML/MediaWiki/JSON. |
| temp_test_output/* | Adds generated TSV outputs (appear to be debugging artifacts rather than test fixtures). |
Comments suppressed due to low confidence (1)
temp_test_output/temp_test_output_Structure.tsv:5
- The
temp_test_output/directory appears to contain generated schema output artifacts (e.g., full Tag/Unit/Property TSV exports) and is not referenced by the test suite. Committing these large, generated files will bloat the repo and can easily become stale. Consider removing this directory from the PR and adding the path to.gitignoreif it is produced locally during debugging.
hedId rdfs:label Attributes omn:SubClassOf dc:description
HED_0040010 ScoreHeader version="1.1.0", library="score", withStandard="8.2.0" HedHeader
HED_0040011 ScorePrologue HedPrologue This schema is a Hierarchical Event Descriptors (HED) Library Schema implementation of Standardized Computer-based Organized Reporting of EEG (SCORE)[1,2] for describing events occurring during neuroimaging time series recordings.\nThe HED-SCORE library schema allows neurologists, neurophysiologists, and brain researchers to annotate electrophysiology recordings using terms from an internationally accepted set of defined terms (SCORE) compatible with the HED framework.\nThe resulting annotations are understandable to clinicians and directly usable in computer analysis.\n\nFuture extensions may be implemented in the HED-SCORE library schema.\nFor more information see https://hed-schema-library.readthedocs.io/en/latest/index.html.
HED_0040012 ScoreEpilogue HedEpilogue The Standardized Computer-based Organized Reporting of EEG (SCORE) is a standard terminology for scalp EEG data assessment designed for use in clinical practice that may also be used for research purposes.\nThe SCORE standard defines terms for describing phenomena observed in scalp EEG data. It is also potentially applicable (with some suitable extensions) to EEG recorded in critical care and neonatal settings.\nThe SCORE standard received European consensus and has been endorsed by the European Chapter of the International Federation of Clinical Neurophysiology (IFCN) and the International League Against Epilepsy (ILAE) Commission on European Affairs.\nA second revised and extended version of SCORE achieved international consensus.\n\n[1] Beniczky, Sandor, et al. "Standardized computer based organized reporting of EEG: SCORE." Epilepsia 54.6 (2013).\n[2] Beniczky, Sandor, et al. "Standardized computer based organized reporting of EEG: SCORE second version." Clinical Neurophysiology 128.11 (2017). \n\nTPA, March 2023
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/data/schema_tests/test_merge/HED_testlib_4.0.0/HED_testlib_4.0.0_Tag.tsv
Outdated
Show resolved
Hide resolved
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.