Add --version flag to colabfold_batch, colabfold_search and colabfold_split_msas - #854
Open
RonitBStudent wants to merge 11 commits into
Open
RonitBStudent wants to merge 11 commits into
RonitBStudent wants to merge 11 commits into
Conversation
Two changes, both already on sokrypton/alphafold3@main. The model table says DeepMind's parameters are granted on request, for non-commercial research, at Google's discretion -- and the install cell was wgetting them from a public bucket and printing "public, no login required". The URL does serve 1,020 MB, but reachable is not the same as ours to hand out. The `alphafold3` entry now looks for a .bin.zst you placed in af3_native_weights/ yourself and, if there is none, says where to request them. Every other model still fetches its own weights. And most of the comments in the three code cells were a log of last night's debugging -- why %%time was removed, what a HuggingFace 429 looked like, which wheel used to be installed. That belongs in the history, not in front of someone trying to fold a protein. No behaviour change; what is left explains a decision a reader cannot infer. Verified on a cold Colab T4 before pushing: setup 34 s, fold 68 s, ATP ligand present (31 HETATM), zero rasa warnings. Also green on A100 (Triton path) and L4 (XLA fallback).
Still too much explaining of history rather than of code: what %%time did, what a 429 looked like, what `Done ->` used to print, the exact RMSDs a language model is worth. What is left says what a line does or why it could not be simpler. No behaviour change; the AlphaFold 3 message still names the request page and the directory to put the file in.
The table row said they are granted on request and the install cell had been changed to match; the bucket is DeepMind's intended public release, so the row is what needed fixing. A copy already in af3_native_weights/ is now used as-is rather than deleted before downloading. Verified on a cold Colab T4: 1 GB in 15 s, fold in 62 s.
The int8 weights were republished with per-block scales (and with the parameters several blobs were missing -- boltz2 and opendde would not load at all). 3.1.10's loader raises on the new scale records, so the pin has to move with them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…_split_msas Reproducible workflows need to record the tool version, but none of the CLIs exposed one. Add a standard argparse `--version` action to all three entry points, backed by a shared `get_version()` helper that reports the installed distribution version plus the git commit when installed from VCS (the same string colabfold_batch already logs at startup). Closes sokrypton#414
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
colabfold_batch --version remains unreachable without the optional AlphaFold dependencies.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds consistent, VCS-aware --version support to the ColabFold command-line tools.
Changes:
- Adds shared version resolution via
get_version(). - Adds
--versionto batch, search, and split-MSAs CLIs. - Reuses the helper for batch startup logging.
| File | Description |
|---|---|
colabfold/utils.py |
Provides installed version and optional commit metadata. |
colabfold/mmseqs/split_msas.py |
Adds split-MSAs version output. |
colabfold/mmseqs/search.py |
Adds search version output. |
colabfold/batch.py |
Adds batch version output and shared logging. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| def main(): | ||
| parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter) | ||
| parser.add_argument("--version", action="version", version=f"%(prog)s {get_version()}") |
colabfold.batch raises at import time when the `alphafold` extra is not installed, so argparse never got to see `--version` in a base install. Answer the flag in that guard before failing, so the version is always reachable.
Author
|
Good catch — Any other invocation still reports the missing extra as before. |
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.

Closes #414
Reproducible pipelines need to record which ColabFold version produced a result, but none of the CLIs exposed one —
colabfold_search --versionjust printed the usage error.This adds a standard argparse
--versionaction to all three entry points:The version string comes from a new
colabfold.utils.get_version(): the installed distribution version, with the git commit appended when installed from VCS (e.g.1.6.3 (abc1234)). That is the same stringcolabfold_batchalready logs at startup, sobatch.pynow reuses the helper instead of assembling it inline.Verified
colabfold_searchandcolabfold_split_msasend to end from a freshpip install -e ..colabfold_batchcannot be imported at all without the[alphafold]extra (pre-existing), so for it I checked the module compiles and that the helper resolves; the parser change is identical to the other two.