Skip to content

Add --version flag to colabfold_batch, colabfold_search and colabfold_split_msas - #854

Open
RonitBStudent wants to merge 11 commits into
sokrypton:mainfrom
RonitBStudent:feat/cli-version-flag
Open

RonitBStudent wants to merge 11 commits into
sokrypton:mainfrom
RonitBStudent:feat/cli-version-flag

Conversation

@RonitBStudent

Copy link
Copy Markdown

Closes #414

Reproducible pipelines need to record which ColabFold version produced a result, but none of the CLIs exposed one — colabfold_search --version just printed the usage error.

This adds a standard argparse --version action to all three entry points:

$ colabfold_search --version
colabfold_search 1.6.3
$ colabfold_split_msas --version
colabfold_split_msas 1.6.3

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 string colabfold_batch already logs at startup, so batch.py now reuses the helper instead of assembling it inline.

Verified colabfold_search and colabfold_split_msas end to end from a fresh pip install -e .. colabfold_batch cannot 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.

sokrypton and others added 10 commits September 16, 2026 18:15
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
Copilot AI lite review requested due to automatic review settings September 18, 2026 22:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

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 --version to 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.

Comment thread colabfold/batch.py

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.
@RonitBStudent

Copy link
Copy Markdown
Author

Good catch — colabfold_batch raises at import when the alphafold extra is missing, so argparse never saw the flag. f95293b answers --version in that import guard before failing, so it now works in a base install too:

$ colabfold_batch --version
colabfold_batch 1.6.3

Any other invocation still reports the missing extra as before.

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.

Add a --version argument

3 participants