Skip to content

Added a string search option for HED (experimental)#1299

Merged
VisLab merged 2 commits intohed-standard:mainfrom
VisLab:enhance_search
Apr 7, 2026
Merged

Added a string search option for HED (experimental)#1299
VisLab merged 2 commits intohed-standard:mainfrom
VisLab:enhance_search

Conversation

@VisLab
Copy link
Copy Markdown
Member

@VisLab VisLab commented Apr 7, 2026

No description provided.

@VisLab VisLab requested a review from Copilot April 7, 2026 12:14
@VisLab VisLab added enhancement New feature or request usability python Pull requests that update Python code labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

Claude code review could not run. The request to the Claude API failed (possible causes: billing limit reached, token expired, or service unavailable). Review this PR manually.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 introduces an experimental, schema-optional HED query engine (StringQueryHandler) that can evaluate the existing QueryHandler expression language directly against raw HED strings, plus supporting utilities and documentation.

Changes:

  • Added hed.models.string_search with StringQueryHandler, a lightweight string parser (parse_hed_string), and a search_series helper for pandas Series.
  • Added hed.models.schema_lookup utilities to precompute/persist a short-tag → tag_terms lookup for ancestor search on short-form strings.
  • Added extensive unit tests and new documentation comparing basic_search, QueryHandler, and StringQueryHandler, plus API doc wiring and exports.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
hed/models/string_search.py Implements lightweight parsing + duck-typed nodes to run QueryHandler expressions on raw strings.
hed/models/schema_lookup.py Generates/saves/loads lookup tables to enable ancestor matching without a live schema object.
hed/__init__.py Exposes the new search/lookup APIs at the package top level.
tests/models/test_string_search.py Adds comprehensive behavioral tests for parsing and query semantics on raw strings.
tests/models/test_schema_lookup.py Adds tests for lookup generation and JSON round-tripping and basic integration with StringQueryHandler.
docs/search_implementation.md Documents tradeoffs and syntax differences across the three search approaches.
docs/index.rst Adds the new documentation page to the docs TOC.
docs/api/models.rst Adds API documentation entries for the new search and lookup utilities.

Comment thread hed/models/schema_lookup.py
Comment thread hed/models/schema_lookup.py
Comment thread docs/search_implementation.md Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

Claude code review could not run. The request to the Claude API failed (possible causes: billing limit reached, token expired, or service unavailable). Review this PR manually.

@VisLab VisLab merged commit 59f0224 into hed-standard:main Apr 7, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update Python code usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants