Skip to content

Commit 3213f4b

Browse files
committed
Release v0.8.12
1 parent 138f827 commit 3213f4b

File tree

5 files changed

+797
-8
lines changed

5 files changed

+797
-8
lines changed

flake.lock

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
description = "A basic flake with a shell";
3+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4+
inputs.systems.url = "github:nix-systems/default";
5+
inputs.flake-utils = {
6+
url = "github:numtide/flake-utils";
7+
inputs.systems.follows = "systems";
8+
};
9+
10+
outputs =
11+
{ nixpkgs, flake-utils, ... }:
12+
flake-utils.lib.eachDefaultSystem (
13+
system:
14+
let
15+
pkgs = nixpkgs.legacyPackages.${system};
16+
in
17+
{
18+
devShells.default = pkgs.mkShell { packages = [ pkgs.bashInteractive ]; };
19+
}
20+
);
21+
}

openprotein/models/foundation/boltzgen.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
from openprotein.models.base import ProteinModel
1212
from openprotein.protein import Protein
1313

14+
from .boltzgen_schema import BoltzGenDesignSpec
15+
1416

1517
class BoltzGenRequest(BaseModel):
1618
"Specification for an BoltzGen request."
1719

1820
n: int = 1
1921
# protein: Protein
2022
structure_text: str | None = None
21-
design_spec: dict[str, Any]
23+
design_spec: BoltzGenDesignSpec | dict[str, Any]
2224
diffusion_batch_size: int | None = None
2325
step_scale: float | None = None
2426
noise_scale: float | None = None
@@ -120,7 +122,7 @@ def get_metadata(self) -> ModelMetadata:
120122

121123
def generate(
122124
self,
123-
design_spec: dict[str, Any],
125+
design_spec: BoltzGenDesignSpec | dict[str, Any],
124126
structure_file: str | bytes | BinaryIO | None = None,
125127
n: int = 1,
126128
diffusion_batch_size: int | None = None,
@@ -133,12 +135,22 @@ def generate(
133135
134136
Parameters
135137
----------
136-
design_spec : dict[str, Any]
137-
The BoltzGen design specification to run. This is the Python representation
138-
of the BoltzGen yaml request specification.
139-
structure_file : BinaryIO, optional
140-
An input PDB file (as a file-like object) used for inpainting or other
141-
guided design tasks where parts of an existing structure are provided.
138+
design_spec : BoltzGenDesignSpec | dict[str, Any]
139+
The BoltzGen design specification to run. Can be a typed BoltzGenDesignSpec
140+
object or a dict representing the BoltzGen yaml request specification.
141+
142+
Note: If the design_spec includes FileEntity objects with `path` fields,
143+
those paths are placeholders. The actual structure file content must be
144+
provided via the `structure_file` parameter below, as the platform backend
145+
currently only accepts structure files this way.
146+
structure_file : str | bytes | BinaryIO | None, optional
147+
An input PDB/CIF file used for inpainting or other guided design tasks
148+
where parts of an existing structure are provided. This parameter provides
149+
the actual structure content that corresponds to any FileEntity `path`
150+
fields in the design_spec. Can be:
151+
- A file path (str) to read from
152+
- Raw file content (bytes)
153+
- A file-like object (BinaryIO)
142154
n : int, optional
143155
The number of unique design trajectories to run (default is 1).
144156
diffusion_batch_size : int, optional
@@ -163,6 +175,10 @@ def generate(
163175
A future object that can be used to retrieve the results of the design
164176
job upon completion.
165177
"""
178+
# Validate design_spec if it's a dict
179+
if isinstance(design_spec, dict):
180+
design_spec = BoltzGenDesignSpec.model_validate(design_spec)
181+
166182
request = BoltzGenRequest(
167183
n=n,
168184
design_spec=design_spec,

0 commit comments

Comments
 (0)