Skip to content

Commit 1e72523

Browse files
committed
refactor
1 parent 228654e commit 1e72523

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+6629
-4990
lines changed

Makefile

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
VERSION ?= 0.4.0
1+
VERSION ?= 0.5.0.dev0
22
SHELL := /bin/bash
33

44
.PHONY: releasehere
55
releasegit:
6-
# Update Poetry version
7-
poetry version $(VERSION)
6+
# Update Pixi version
7+
pixi project version set $(VERSION)
88

99
# Update version in meta.yaml
10-
sed -i 's/^ version: .*/ version: "$(VERSION)"/' anaconda_build/meta.yaml
10+
# sed -i'' 's/^ version: .*/^ version: "$(VERSION)"/' anaconda_build/meta.yaml
11+
perl -i -pe's/^ version: .*/ version: "$(VERSION)"/' anaconda_build/meta.yaml
1112

1213
# Commit changes
1314
git add pyproject.toml anaconda_build/meta.yaml
@@ -20,8 +21,6 @@ releasegit:
2021
git push origin HEAD
2122
git push origin v$(VERSION)
2223

23-
curl -X PURGE https://camo.githubusercontent.com/125a275204c801f733fd69689c1e72bde9960a1e193c9c46299d848373a52a93/68747470733a2f2f616e61636f6e64612e6f72672f6f70656e70726f7465696e2f6f70656e70726f7465696e2d707974686f6e2f6261646765732f76657273696f6e2e737667
24-
2524

2625
releasehere:
2726
# Update Poetry version
@@ -47,8 +46,10 @@ releasehere:
4746

4847
#conda
4948
source activate bld && conda build ./anaconda_build
50-
51-
curl -X PURGE https://camo.githubusercontent.com/125a275204c801f733fd69689c1e72bde9960a1e193c9c46299d848373a52a93/68747470733a2f2f616e61636f6e64612e6f72672f6f70656e70726f7465696e2f6f70656e70726f7465696e2d707974686f6e2f6261646765732f76657273696f6e2e737667
49+
50+
condabld:
51+
micromamba activate openprotein-sdk-build
52+
conda build -c conda-forge --numpy 2.1 ./anaconda_build
5253

5354
proddocs:
5455
cd apidocs && make clean && make html
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
numpy:
2+
- 2.1

anaconda_build/meta.yaml

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: openprotein-python
3-
version: "0.4.1"
3+
version: "0.5.0.dev0"
44

55
source:
66
path: ../
@@ -12,18 +12,19 @@ build:
1212

1313
requirements:
1414
build:
15-
- python >=3.7
16-
- poetry
15+
- python >=3.10,<3.11
16+
- hatchling >=1.25.0,<2
1717
host:
18-
- python >=3.7
18+
- python >=3.10,<3.11
1919
- pip
20-
- poetry
20+
- hatchling >=1.25.0,<2
2121
run:
22-
- python >=3.7
23-
- requests >=2.0
24-
- pydantic >=1.0
25-
- tqdm >=4.0
26-
- pandas >=1.0
22+
- python >=3.10,<3.11
23+
- requests >=2.32.3,<3
24+
- pydantic >=2.5,<3
25+
- tqdm >=4.66.5,<5
26+
- pandas >=2.1.4,<3
27+
- numpy >=2.1.1,<3
2728

2829
about:
2930
home: https://www.openprotein.ai/

openprotein/__init__.py

+40-17
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
from openprotein._version import __version__
2-
2+
from openprotein.app import (
3+
SVDAPI,
4+
AlignAPI,
5+
AssayDataAPI,
6+
DesignAPI,
7+
EmbeddingsAPI,
8+
FoldAPI,
9+
JobsAPI,
10+
PredictorAPI,
11+
TrainingAPI,
12+
)
13+
from openprotein.app.models import Future
314
from openprotein.base import APISession
4-
from openprotein.api.jobs import JobsAPI, Job
5-
from openprotein.api.data import DataAPI
6-
from openprotein.api.align import AlignAPI
7-
from openprotein.api.embedding import EmbeddingAPI
8-
from openprotein.api.train import TrainingAPI
9-
from openprotein.api.design import DesignAPI
10-
from openprotein.api.fold import FoldAPI
11-
from openprotein.api.jobs import load_job
1215

1316

1417
class OpenProtein(APISession):
@@ -17,20 +20,22 @@ class OpenProtein(APISession):
1720
"""
1821

1922
_embedding = None
23+
_svd = None
2024
_fold = None
2125
_align = None
2226
_jobs = None
2327
_data = None
2428
_train = None
2529
_design = None
30+
_predictor = None
2631

27-
def wait(self, job: Job, *args, **kwargs):
28-
return job.wait(self, *args, **kwargs)
32+
def wait(self, future: Future, *args, **kwargs):
33+
return future.wait(*args, **kwargs)
2934

3035
wait_until_done = wait
3136

3237
def load_job(self, job_id):
33-
return load_job(self, job_id)
38+
return self.jobs.__load(job_id=job_id)
3439

3540
@property
3641
def jobs(self) -> JobsAPI:
@@ -42,12 +47,12 @@ def jobs(self) -> JobsAPI:
4247
return self._jobs
4348

4449
@property
45-
def data(self) -> DataAPI:
50+
def data(self) -> AssayDataAPI:
4651
"""
4752
The data submodule gives access to functionality for uploading and accessing user data.
4853
"""
4954
if self._data is None:
50-
self._data = DataAPI(self)
55+
self._data = AssayDataAPI(self)
5156
return self._data
5257

5358
@property
@@ -62,21 +67,39 @@ def train(self) -> TrainingAPI:
6267
@property
6368
def align(self) -> AlignAPI:
6469
"""
65-
The PoET submodule gives access to the PoET generative model and MSA and prompt creation interfaces.
70+
The Align submodule gives access to the sequence alignment capabilities by building MSAs and prompts that can be used with PoET.
6671
"""
6772
if self._align is None:
6873
self._align = AlignAPI(self)
6974
return self._align
7075

7176
@property
72-
def embedding(self) -> EmbeddingAPI:
77+
def embedding(self) -> EmbeddingsAPI:
7378
"""
7479
The embedding submodule gives access to protein embedding models and their inference endpoints.
7580
"""
7681
if self._embedding is None:
77-
self._embedding = EmbeddingAPI(self)
82+
self._embedding = EmbeddingsAPI(self)
7883
return self._embedding
7984

85+
@property
86+
def svd(self) -> SVDAPI:
87+
"""
88+
The embedding submodule gives access to protein embedding models and their inference endpoints.
89+
"""
90+
if self._svd is None:
91+
self._svd = SVDAPI(self, self.embedding)
92+
return self._svd
93+
94+
@property
95+
def predictor(self) -> PredictorAPI:
96+
"""
97+
The predictor submodule gives access to training and predicting with predictors built on top of embeddings.
98+
"""
99+
if self._predictor is None:
100+
self._predictor = PredictorAPI(self, self.embedding, self.svd)
101+
return self._predictor
102+
80103
@property
81104
def design(self) -> DesignAPI:
82105
"""

openprotein/api/__init__.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
from . import data
2-
from . import design
3-
from . import train
4-
from . import predict
5-
from . import align
6-
from . import embedding
7-
from . import fold
1+
from . import align, assaydata, design, embedding, fold, predict, predictor, train
2+
from .deprecated import poet

0 commit comments

Comments
 (0)