Skip to content

Drop the sw rerank mode; tidy CLI warnings, README, add CI - #37

Merged
Cassie818 merged 6 commits into
mainfrom
remove-sw-rerank
Oct 30, 2026
Merged

Cassie818 merged 6 commits into
mainfrom
remove-sw-rerank

Conversation

@Cassie818

@Cassie818 Cassie818 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Ranking now has two modes: tm_a (default, R_str = S_SW × TM_a) and tm (RFoldSearch-TM, US-align). --rerank sw is gone from the library, CLI and web API.
  • sw_score is still computed for every tm_a hit and still drives the E-value, so E-values don't change.
  • The CLI's SW-only output table and the web UI's sw column branch are removed. The web form only ever offered tm_a and tm.
  • README and webserver/README updated.

Behaviour change

sw was the only mode that could search a database without C4′ coordinates. Such databases now raise an error and must be rebuilt from structures. Databases built with rfoldsearch build already carry coordinates.

Tests

  • E-value tests that used rerank="sw" now add coordinates to their fixtures (helpers.add_coords; the database fingerprint only hashes tokens) and use the default mode.
  • New tests check that sw is rejected by both Searcher.search and the CLI.
  • test_paper_db now checks the same three S_SW values without depending on SW order (it skips unless RFOLDSEARCH_PAPER_DB is set, so it was not run here).
  • pytest tests: 89 passed, 2 skipped (paper DB not set, USalign not installed).

Also in this PR

  • CLI warnings: rfoldsearch now prints each warning as one rfoldsearch: warning: … line on stderr, without Python echoing the s = Searcher(a.db, … source line after it.

  • README: the search output headers show the database size as the CLI prints it, and the Python API hit dict lists length.

  • CI: new .github/workflows/tests.yml runs pytest tests on Ubuntu with Python 3.10 and 3.11 (CPU-only torch).

  • Python ≥ 3.10: requires-python raised from 3.9; the 3.9-only numpy<2 marker and the webserver README note about it are gone. The 3.9 install took minutes to resolve in CI.

  • Calibration reproducibility: calibrate_clustermax (and its length-dependent variant) picked the query pool with an unstable argsort, so chains tied on length were chosen differently on different CPUs. This made the first CI run fail on Linux x86 (test_a_cluster_contributes_one_draw_however_many_members). It now uses a stable sort. Already-packaged E-value parameters are unaffected, but a refit may pick different queries than before.

pytest tests locally: 90 passed, 2 skipped. webserver/static/app.js passes a JavaScriptCore syntax check.

Ranking now has two modes: tm_a (default, R_str = S_SW x TM_a) and tm
(US-align). S_SW is still computed for every tm_a hit and still drives
the E-value. Databases without C4' coordinates can no longer be
searched; rebuild them from structures.

The CLI and web API reject rerank=sw. Tests that used sw to check
E-values now give their fixtures coordinates and use the default mode.
Python's default handler echoes the source line after each warning, so
every search of an uncalibrated database printed 's = Searcher(a.db, ...'
under the E-value notice.
The header names the database size, and the hit dicts carry 'length'.
Python 3.9 and 3.11 on Ubuntu, with CPU-only torch. Tests that need
US-align or the paper database skip themselves.
@Cassie818 Cassie818 changed the title Drop the token-only sw rerank mode Drop the sw rerank mode; tidy CLI warnings, README, add CI Oct 30, 2026
The last biotite release for 3.9 is built against NumPy 1, which forced a
numpy<2 marker, and pip took minutes to resolve the 3.9 install in CI.
CI now tests 3.10 and 3.11.
calibrate_clustermax chose its query pool with numpy's default argsort,
which orders ties differently across array sizes and CPUs. The same
database could therefore be calibrated from different queries on macOS
and on Linux x86, and test_a_cluster_contributes_one_draw_however_many_members
failed in CI (beta moved by 8.6%). With a stable sort the swamped and
unswamped fits now give the same beta.
@Cassie818
Cassie818 merged commit 6c89474 into main Oct 30, 2026
2 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.

1 participant