Skip to content

Addressed search critique in #1258#1281

Merged
VisLab merged 4 commits intohed-standard:mainfrom
VisLab:fix_extras
Mar 25, 2026
Merged

Addressed search critique in #1258#1281
VisLab merged 4 commits intohed-standard:mainfrom
VisLab:fix_extras

Conversation

@VisLab
Copy link
Copy Markdown
Member

@VisLab VisLab commented Mar 25, 2026

Several of the items, including the O(n^2) operations will require a redesign and were not implemented.

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 updates the HED query/search implementation and related tests to address critique items raised in #379, focusing on clearer query parse errors, more explicit match-mode handling, and improved traversal performance in HedGroup.

Changes:

  • Improve get_query_handlers error reporting by including exception details for bad queries.
  • Update query parsing behavior (tokenization and match-mode constants) and add targeted regression tests.
  • Optimize HedGroup.get_all_tags / get_all_groups traversal by switching to deque to avoid O(n²) list operations.

Reviewed changes

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

Show a summary per file
File Description
hed/models/query_service.py Include exception details in bad-query issue strings returned by get_query_handlers.
hed/models/query_util.py Update comment describing Token.NotInLine.
hed/models/query_handler.py Remove [[ / ]] from tokenizer so [[a]] parses as nested descendant groups.
hed/models/query_expressions.py Replace implicit/bool match-mode flags with named constants and update matching logic accordingly.
hed/models/hed_group.py Use collections.deque in traversal helpers to avoid repeated pop(0) operations.
tests/models/test_query_service.py Add new unit tests for get_query_handlers and search_hed_objs.
tests/models/test_query_handler.py Add regression tests for double-bracket handling and match-mode constants.

@VisLab VisLab merged commit 42d97f9 into hed-standard:main Mar 25, 2026
23 of 24 checks passed
@VisLab VisLab changed the title Addressed search critique in #379 Addressed search critique in #1258 Mar 25, 2026
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