Skip to content

Searches without complexes no longer crash - #77

Merged
amjjbonvin merged 1 commit into
mainfrom
76-collect-no-complexes
Nov 21, 2026
Merged

amjjbonvin merged 1 commit into
mainfrom
76-collect-no-complexes

Conversation

@amjjbonvin

Copy link
Copy Markdown
Member

What does this PR do and why?

Fixes two crashes of searches without complexes, found with the haddock3 protein-ligand example (neuraminidase and oseltamivir):

  • _collect_complexes skips its final pruning when nothing was collected. With max_complexes (the default of --max-complexes), a search, or a job of -p N, without any complex consistent with a restraint called _smallest_keys([]) (ValueError: need at least one array to concatenate, queue.Empty in the parent).
  • Without any accessible complex, write_results raises a ValueError and disvis exits with an ERROR: message, pointing to --min-interaction and --max-clash, instead of an IndexError in the false-positive analysis.

How was this tested?

  • New unit test: a search with an unreachable min_interaction and max_complexes collects no complexes, and write_results raises the error. It fails without the change.
  • python -W error -m unittest: 49 tests OK (9 GPU tests skipped).
  • Protein-ligand example, -p 12 -wc 75: ValueError before, the new error after; with -iv 100, 15956 complexes are found.
  • E2A-HPR (-a 20 -vs 2 -p 4 -wc 75): result files byte-identical to before.

AI assistance

Written with Claude Code (Claude Opus 5.5). Checked with the test and runs above.

Checklist

  • Tests cover the new and/or changed code
  • Documentation updated if needed (README.md, INSTALLATION.md) — not needed
  • Reference results in test-cases/*/example-results/ updated if the output changes — output unchanged

Related issues

Closes #76

Notes for reviewers

The default --min-interaction (300 A^3) is too large for small molecules such as oseltamivir (44 atoms); this PR only makes the error say so.

_collect_complexes skips its final pruning when nothing was collected (a
job of -p N without any complex consistent with a restraint raised a
ValueError with max_complexes). Without any accessible complex,
write_results raises a ValueError and disvis exits with a clear error,
pointing to --min-interaction for small molecules, instead of an
IndexError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amjjbonvin
amjjbonvin merged commit df38852 into main Nov 21, 2026
21 checks passed
@amjjbonvin
amjjbonvin deleted the 76-collect-no-complexes branch November 21, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when a search finds no complexes (-p N with -wc, or no accessible complexes)

1 participant