Skip to content

Add aug 21 release - #94

Merged
shuchenliu merged 5 commits into
mainfrom
add-aug-21-release
Aug 31, 2026
Merged

shuchenliu merged 5 commits into
mainfrom
add-aug-21-release

Conversation

@shuchenliu

Copy link
Copy Markdown
Member
  1. add more benchmarks on /publications searching strategies
  2. clean up ES configs

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 expands the /publications lookup/benchmarking surface by adding a new combined-search strategy (single ES query that can match both PMIDs and alternate identifiers) and by improving benchmark integrity reporting, while also simplifying Elasticsearch connection presets/configuration.

Changes:

  • Add combined-search as a supported /publications lookup strategy, plus _meta.lookup_fallback to indicate when a speculative ES path was rejected and the request fell back.
  • Generalize the publications benchmark harness to support explicitly ordered strategy pairs (--compare-strategies), enforce lookup_fallback == false for paired integrity, and improve changed-path/order accounting.
  • Clean up Elasticsearch connection presets (drop legacy aliases, standardize on in_cluster, ci_forward, test_forward) and update docs/tests accordingly.

Reviewed changes

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

Show a summary per file
File Description
tests/test_pubmed.py Updates default integration ES connection preset name.
tests/test_publications_load.py Extends CLI/paired-benchmark tests for explicit strategy pairs and fallback attribution.
tests/test_elasticsearch.py Adds coverage for search_ids_or_terms and updates expected connection preset set.
tests/test_document_metadata.py Adds extensive coverage for combined-search behavior and lookup-fallback metadata in /publications.
tests/test_backend_parity.py Updates parity tests to use in_cluster connection preset.
README.md Documents new strategy options, fallback attribution semantics, and updated ES preset names.
biothings_annotator/application/views/document_metadata.py Adds combined-search service instance and exposes _meta.lookup_fallback in responses.
biothings_annotator/annotator/settings.py Simplifies ES preset config and introduces DEFAULT_ELASTICSEARCH_CONNECTION.
biothings_annotator/annotator/elasticsearch.py Introduces search_ids_or_terms query helper with named-clause attribution passthrough.
biothings_annotator/annotator/document_metadata.py Implements combined-search fetch + reverse-mapping and returns per-request fallback metadata.
biothings_annotator/annotator/annotator.py Uses DEFAULT_ELASTICSEARCH_CONNECTION for env defaulting.
benchmarks/publications/workload.py Adds strategy defaults and default comparison pair constants.
benchmarks/publications/runner.py Generalizes paired comparison to arbitrary strategy pairs; tracks fallback attribution; changed-path stratification.
benchmarks/publications/report.py Renders dynamic “experiment minus control” deltas and includes fallback integrity counters.
benchmarks/publications/metrics.py Tracks lookup_fallback counts in stage/arm summaries.
benchmarks/publications/main.py Adds --compare-strategies, fixes lookup-strategy defaulting, and threads strategies into comparison runs.
benchmarks/publications/init.py Exports new defaults for external callers.
Suppressed comments (4)

tests/test_document_metadata.py:1653

  • This test uses elasticsearch_connection="ci", but the preset was removed from ELASTICSEARCH_CONNECTIONS in this PR. Prefer a valid preset name (e.g. in_cluster) to keep the test aligned with supported configuration values.
    results, not_found, lookup_fallback = await DocumentMetadataService(
        elasticsearch_connection="ci",
        lookup_strategy=lookup_strategy,
    ).get_publications_with_metadata(publication_ids)

tests/test_document_metadata.py:1685

  • This test uses elasticsearch_connection="ci", but the preset was removed from ELASTICSEARCH_CONNECTIONS in this PR. Using a supported preset here avoids confusing future readers about which connection names are valid.
    _, not_found, lookup_fallback = await DocumentMetadataService(
        elasticsearch_connection="ci",
        lookup_strategy=lookup_strategy,
    ).get_publications_with_metadata(publication_ids)

tests/test_document_metadata.py:1711

  • This test uses elasticsearch_connection="ci", but the preset was removed from ELASTICSEARCH_CONNECTIONS in this PR. Prefer a supported preset name so the test input reflects real configuration.
    results, not_found, lookup_fallback = await DocumentMetadataService(
        elasticsearch_connection="ci",
        lookup_strategy=lookup_strategy,
    ).get_publications_with_metadata([PMID, DOI])

tests/test_document_metadata.py:1744

  • This test uses elasticsearch_connection="ci", but the preset was removed from ELASTICSEARCH_CONNECTIONS in this PR. Switching to a supported preset keeps the test consistent with the cleaned-up connection config.
    service = DocumentMetadataService(
        elasticsearch_connection="ci",
        lookup_strategy=BULK_SEARCH_LOOKUP_STRATEGY,
    )

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

Comment thread benchmarks/publications/runner.py
Comment thread benchmarks/publications/runner.py Outdated
Comment thread tests/test_document_metadata.py
@shuchenliu
shuchenliu merged commit 82d3acc into main Aug 31, 2026
10 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.

2 participants