Repository navigation
Simplify scoring, report and biophysics code without changing outputs - #31
Merged
DimaMolod merged 1 commit intoSep 28, 2026
Conversation
A pass over the package for dead code, duplicated logic and needless indirection. Scores, CSVs, report PDFs and PAE PNGs are byte-identical to the previous commit on every bundled AF2, AF3, AF3x and Boltz-2 run (all models, per-run and aggregate reports, cache reuse, non-default thresholds), the raw Connolly dot surfaces are bitwise equal, and the full test suite passes including the slow CCP4 SC reference checks. report.py (2031 -> ~1370 lines): drop the page-total/footer plumbing that nothing read, the never-drawn logo and info icon, an unused row grouper and slider-marker branch. Repeated axes setup and text boilerplate go through small _text_axes/_label_axes/_kv_rows helpers. runner.py: one worker partial serves the serial and process-pool paths, the cache/recompute branches share the report and aggregation tail, and each CSV row is built by _interface_row. Unused matplotlib/numpy imports and a deferred import of an already-imported module are gone. Interface/Complex: one pair-index generator replaces four copies of the residue-to-PAE lookup; mpDockQ's global contact count is the sum of the per-interface counts (the same <= r^2 test Biopython's KD-tree applies) instead of a second neighbour search; a per-pair atom cache that could never hit is removed. Interface.label and Complex.chain_boundaries replace private-attribute access from the runner. Parsers: magic-byte decompression is shared by JSON and pickle loading, path lookups share _first_existing, and ParserManager keeps only register/pick. Biophysics: bonds.py uses one KD-tree contact generator for H-bonds, salt bridges and disulfides; prosurf.py computes each side's area through one coverage helper; connolly.py loses an unused trim(), _disptl and a never-read neighbour list, and shares the probe-torus geometry between its two users; sc.py and solvation.py drop redundant bookkeeping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DimaMolod
marked this pull request as ready for review
September 28, 2026 12:17
DimaMolod
merged commit Sep 28, 2026
e206c1c
into
30-alphajudge-pae-handling-for-af3x-outputs-cross-linker-tokens
12 checks passed
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.
A simplification pass over the package: dead code, duplicated logic and needless indirection. No output changes. Net −1,257 lines (920 added, 2,177 removed).
report.pygoes from 2,031 to about 1,370 lines andconnolly.pyfrom 910 to 750.This targets the #30 branch, so the diff shows only the cleanup.
Verification
--skip_biophysical_scores, non-default thresholds, and thealphajudge-reportentry point. Report timestamps were frozen for the comparison. All 63 CSV, PDF and PNG files are byte-identical to the base commit. The base itself was checked to be deterministic across two runs.pytest test/passes 92/92 withALPHAJUDGE_RUN_SLOW_SC_REFERENCE=1.What changed
report.py. Removed:
Repeated axes setup and text boilerplate now go through
_text_axes,_label_axes,_kv_rowsand_save_page. The aggregate report no longer sorts lists that are already sorted, and counts backends withCounter.runner.py.
functools.partialworker serves both the serial and process-pool paths._interface_row.Interface / Complex.
_pair_indices()replaces four copies of the residue-to-PAE lookup.d² <= r²test, so a second neighbour search is gone.Interface.labelandComplex.chain_boundariesreplace private-attribute access from the runner.Parsers.
BaseParser._first_existing.ParserManagerkeeps onlyregisterandpick.Biophysics.
trim(),_disptland a neighbour list that was never read; shared probe-torus geometry between its two users.scripts/. Smaller
validate_ccp4_biophysics.pyparsing, and the PISA session is now erased even if-analysefails.STANDARD_AAis a single line.Removed API, all with no callers (noted in CHANGELOG):
ParserManager.unregister,enable_only,set_precedence,list_parsersconfident_contacts.representative_atom_contact_pairsbiophysics.connolly.trimresidue_namesargument ofconnolly.mdsalphajudge.coreandalphajudge.biophysics.scoringstill import as before.Follow-up
The problems found during this review are fixed in the stacked draft PR #32. They change results, so they are kept out of this no-output-change PR:
af3.pyand test-import leftovers are cleaned up.🤖 Generated with Claude Code