Skip to content

Fix Complex Portal search paging; correct the corrections() docs example - #60

Merged
edkerk merged 2 commits into
developfrom
fix/complex-portal-paging
Sep 24, 2026
Merged

edkerk merged 2 commits into
developfrom
fix/complex-portal-paging

Conversation

@edkerk

@edkerk edkerk commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

The Complex Portal search endpoint reports size as the number of elements in the page at hand and totalNumberOfResults as the grand total, and first counts records rather than pages.

get_complex_data read size as the total, so the paging loop ended after the first page and any organism with more than 100 complexes was silently truncated. S. cerevisiae (taxonomy 559292) returned 100 of its 634 complexes.

This pages by record offset, takes the total from totalNumberOfResults, and logs a warning instead of truncating silently if the page bound is ever reached. The test fixtures now use the real field semantics, and test_search_paginates checks the record offset and the total.

Also corrects the example in docs/evotune_kcat_tuning.md: annotate_from_model returns names, ec_codes and sources, but EvotuneResult.corrections() takes only names and ec_codes (it fills the sources from result.groups), so the documented **annotations call raised TypeError.

The Complex Portal search endpoint reports `size` as the number of
elements in the page at hand and `totalNumberOfResults` as the grand
total, and `first` counts records rather than pages. Reading `size` as
the total ended the paging loop after the first page, so any organism
with more than 100 complexes was silently truncated: S. cerevisiae
(taxonomy 559292) returned 100 of its 634.

Page by record offset, take the total from `totalNumberOfResults`, and
warn rather than truncate silently if the page bound is ever reached.
The test fixtures now use the real field semantics.
`annotate_from_model` returns names, ec_codes and sources, but
`EvotuneResult.corrections()` fills sources from `result.groups`
itself and has no such keyword, so the documented
`result.corrections(leverage=leverage, **annotations)` raises
TypeError. Spell the two keywords it does take, and say where the
third one goes.
@edkerk edkerk changed the title complex_portal_download: page the search by record offset and total Fix Complex Portal search paging; correct the corrections() docs example Sep 24, 2026
@edkerk
edkerk merged commit a725bb3 into develop Sep 24, 2026
5 checks passed
@edkerk
edkerk deleted the fix/complex-portal-paging branch September 24, 2026 20:22
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.

1 participant