Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8de7282
Create environment_Mac.yaml
fnachon Apr 7, 2025
f2b0fc4
add pyproject.toml
fnachon Apr 9, 2025
2f2395e
Update README.md
fnachon Apr 9, 2025
21d28d3
Update chroma.py
fnachon Apr 9, 2025
666eda2
Update conditioners.py
fnachon Apr 9, 2025
f75483b
add mps
fnachon Apr 9, 2025
4454181
Update model.py
fnachon Apr 9, 2025
590c2d3
Update protein.py
fnachon Apr 9, 2025
bfe70c9
add mps device
fnachon Apr 10, 2025
f9d046c
change install files
fnachon Apr 10, 2025
b9dd884
Update graph_backbone.py
fnachon Apr 10, 2025
6b1790b
Update graph_classifier.py
fnachon Apr 10, 2025
445ed2e
update for mps vs cpu
fnachon Apr 10, 2025
3be0059
Update .gitignore
fnachon Apr 10, 2025
4f4dd5c
Workaround for cholesky on mps
fnachon Apr 10, 2025
4e02897
Update transforms.py
fnachon Apr 10, 2025
def001a
Update backbone.py
fnachon Apr 10, 2025
5915f18
Update rmsd.py
fnachon Apr 10, 2025
36072c0
Merge pull request #1 from fnachon/mps-enabled
fnachon Apr 13, 2025
b338b53
Update .gitignore
fnachon Apr 13, 2025
20cf5eb
Merge branch 'main' of https://github.com/fnachon/chroma
fnachon Apr 13, 2025
b386206
Refactor packaging, tests, and locked environments
fnachon Apr 6, 2026
497feec
Ignore personal directory
fnachon Apr 7, 2026
4b4afb7
Lazy-load top-level package exports
fnachon Apr 7, 2026
42fdad1
Fix attention masking, MPS fallback robustness, and code deduplication
fnachon Jun 30, 2026
3f0893f
Upgrade pytorch to 2.12.1
fnachon Jun 30, 2026
0e666e7
Commit missing test fixture .cif files ignored by gitignore
fnachon Jul 3, 2026
db2b74e
Fix remaining CI failures in layers job
fnachon Jul 3, 2026
1e5c172
Fix correctness bugs, security issues, and dead code found in review
fnachon Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
pull_request:
push:
branches:
- main

jobs:
quick-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: data-utility
path: "tests/data tests/utility"
- name: models
path: "tests/models"
- name: layers
path: "tests/layers"
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: false
miniforge-version: latest
- name: Create Locked Environment
shell: bash -el {0}
run: conda create -y -n chroma --file environment.linux-64.lock
- name: Install Package
shell: bash -el {0}
run: conda run -n chroma python -m pip install --no-deps -e .
- name: Run Quick Tests
shell: bash -el {0}
run: conda run -n chroma python -m pytest -q -m "not integration and not slow" ${{ matrix.path }}

integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: false
miniforge-version: latest
- name: Create Locked Environment
shell: bash -el {0}
run: conda create -y -n chroma --file environment.linux-64.lock
- name: Install Package
shell: bash -el {0}
run: conda run -n chroma python -m pip install --no-deps -e .
- name: Run Integration Tests
shell: bash -el {0}
run: conda run -n chroma python -m pytest -q tests/models/test_chroma.py tests/utility/test_api.py tests/data/test_system.py

release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: false
miniforge-version: latest
- name: Create Locked Environment
shell: bash -el {0}
run: conda create -y -n chroma --file environment.linux-64.lock
- name: Install Package
shell: bash -el {0}
run: conda run -n chroma python -m pip install --no-deps -e .
- name: Build Artifacts
shell: bash -el {0}
run: conda run -n chroma python -m build
- name: Check Artifacts
shell: bash -el {0}
run: conda run -n chroma python -m twine check dist/*
- name: Packaging Smoke Test
shell: bash -el {0}
run: conda run -n chroma python -m pytest -q tests/utility/test_packaging.py
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.tsv
*.pdb
*.cif
!tests/resources/*.cif
*.pk
*.pt
*.fasta
Expand All @@ -24,6 +25,8 @@ __mmtf__
__pycache__
public
htmlcov
build
dist
make.bat
examples
chroma/layers/structure/params/centering_2g3n.params
Expand All @@ -32,3 +35,4 @@ config.json

# ides
.vscode
/personal/
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,36 @@ Note that your contributions will be governed by the Apache 2.0 license, meaning
Please use GitHub pull requests to contribute code. See
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests. We will try to monitor incoming requests with some regularity, but cannot promise a specific timeframe within which we will review your request.

## Tests and Fixtures

Use the `chroma` Conda environment for local testing. The repository CI workflow in
[`.github/workflows/ci.yml`](.github/workflows/ci.yml) runs the data and utility,
model, layer, integration, and release smoke suites separately. The shared
cross-platform CI environment is [`environment.yml`](environment.yml), while
[`environment_Mac.yaml`](environment_Mac.yaml) keeps the Apple Silicon local setup
used during development. CI installs from
[`environment.linux-64.lock`](environment.linux-64.lock), and Apple Silicon
local development should use
[`environment.osx-arm64.lock`](environment.osx-arm64.lock).

To regenerate the explicit lockfiles from [`environment.yml`](environment.yml),
run:

```bash
python scripts/generate_lockfiles.py
```

The Linux lock targets `__glibc=2.17`, which matches the minimum ABI required
by the pinned `linux-64` packages and is sufficient for the GitHub Actions
`ubuntu-latest` runners used by CI.

Fixture provenance and regeneration notes live in
[`tests/resources/README.md`](tests/resources/README.md), including the generated
`steps200_seed42_len100.cif` sample used by `tests/models/test_chroma.py`.

For quick local iteration, you can skip the heavier tiers with:

```bash
pytest -m "not integration and not slow"
```
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,30 @@ Internally, Chroma uses diffusion modeling, equivariant graph neural networks, a
* [Chroma API Tutorial](https://colab.research.google.com/github/generatebio/chroma/blob/main/notebooks/ChromaAPI.ipynb): Code notebook demonstrating protein I/O, sampling, and design configuration directly in `python`.
* [Chroma Conditioner API Tutorial](https://colab.research.google.com/github/generatebio/chroma/blob/main/notebooks/ChromaConditioners.ipynb): A deeper dive under the hood for implementing new Chroma [Conditioners](#conditioner-api).

**PyPi package**.You can install the latest release of Chroma with:

**Install Chroma from GitHub**

Create a locked Conda environment for your platform

```
pip install generate-chroma
conda create -n chroma --file environment.osx-arm64.lock
```

**Install latest Chroma from github**
On Linux, use:

```
conda create -n chroma --file environment.linux-64.lock
```

The shared source spec is `environment.yml`, and `environment_Mac.yaml`
remains available as the Apple Silicon YAML variant used during development.

Clone from github and install as a package

```
git clone https://github.com/generatebio/chroma.git
pip install -e chroma # use `-e` for it to be editable locally.
conda activate chroma
python -m pip install --no-deps -e . # use `-e` for it to be editable locally.
```

## Sampling
Expand Down Expand Up @@ -101,7 +116,7 @@ The value of diffusion time conditioning $t$ can be set via the `design_t` param
from chroma import Protein, Chroma
chroma = Chroma()

protein = Protein('1GFP')
protein = Protein.from_PDBID('1GFP')
protein = chroma.design(protein)

protein.to("1GFP-redesign.cif")
Expand Down
19 changes: 15 additions & 4 deletions chroma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from importlib import import_module

__version__ = "1.0.0"
from chroma.data.protein import Protein
from chroma.layers.structure import conditioners
from chroma.models.chroma import Chroma
from chroma.utility import api
__all__ = ["__version__", "Protein", "conditioners", "Chroma", "api"]


def __getattr__(name):
if name == "Protein":
return import_module("chroma.data.protein").Protein
if name == "conditioners":
return import_module("chroma.layers.structure.conditioners")
if name == "Chroma":
return import_module("chroma.models.chroma").Chroma
if name == "api":
return import_module("chroma.utility.api")
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
Loading