Repository navigation
Drop the sw rerank mode; tidy CLI warnings, README, add CI - #37
Merged
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tm_a(default, R_str = S_SW × TM_a) andtm(RFoldSearch-TM, US-align).--rerank swis gone from the library, CLI and web API.sw_scoreis still computed for everytm_ahit and still drives the E-value, so E-values don't change.swcolumn branch are removed. The web form only ever offeredtm_aandtm.Behaviour change
swwas 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 withrfoldsearch buildalready carry coordinates.Tests
rerank="sw"now add coordinates to their fixtures (helpers.add_coords; the database fingerprint only hashes tokens) and use the default mode.swis rejected by bothSearcher.searchand the CLI.test_paper_dbnow checks the same three S_SW values without depending on SW order (it skips unlessRFOLDSEARCH_PAPER_DBis 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:
rfoldsearchnow prints each warning as onerfoldsearch: warning: …line on stderr, without Python echoing thes = 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.ymlrunspytest testson Ubuntu with Python 3.10 and 3.11 (CPU-only torch).Python ≥ 3.10:
requires-pythonraised from 3.9; the 3.9-onlynumpy<2marker 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 unstableargsort, 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 testslocally: 90 passed, 2 skipped.webserver/static/app.jspasses a JavaScriptCore syntax check.