openprotein-python 0.3.2__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
openprotein/__init__.py CHANGED
@@ -3,79 +3,97 @@ from openprotein._version import __version__
3
3
  from openprotein.base import APISession
4
4
  from openprotein.api.jobs import JobsAPI, Job
5
5
  from openprotein.api.data import DataAPI
6
- from openprotein.api.poet import PoetAPI
6
+ from openprotein.api.align import AlignAPI
7
7
  from openprotein.api.embedding import EmbeddingAPI
8
8
  from openprotein.api.train import TrainingAPI
9
9
  from openprotein.api.design import DesignAPI
10
- from openprotein.api.predict import PredictAPI
11
10
  from openprotein.api.fold import FoldAPI
11
+ from openprotein.api.jobs import load_job
12
+
12
13
 
13
14
  class OpenProtein(APISession):
14
15
  """
15
16
  The base class for accessing OpenProtein API functionality.
16
17
  """
17
18
 
19
+ _embedding = None
20
+ _fold = None
21
+ _align = None
22
+ _jobs = None
23
+ _data = None
24
+ _train = None
25
+ _design = None
26
+
18
27
  def wait(self, job: Job, *args, **kwargs):
19
28
  return job.wait(self, *args, **kwargs)
20
-
29
+
21
30
  wait_until_done = wait
22
31
 
32
+ def load_job(self, job_id):
33
+ return load_job(self, job_id)
34
+
23
35
  @property
24
- def jobs(self):
36
+ def jobs(self) -> JobsAPI:
25
37
  """
26
38
  The jobs submodule gives access to functionality for listing jobs and checking their status.
27
39
  """
28
- return JobsAPI(self)
29
-
40
+ if self._jobs is None:
41
+ self._jobs = JobsAPI(self)
42
+ return self._jobs
43
+
30
44
  @property
31
- def data(self):
45
+ def data(self) -> DataAPI:
32
46
  """
33
- The data submodule gives access to functionality for uploading and accessing user data.
47
+ The data submodule gives access to functionality for uploading and accessing user data.
34
48
  """
35
- return DataAPI(self)
36
-
37
- @property
38
- def train(self):
49
+ if self._data is None:
50
+ self._data = DataAPI(self)
51
+ return self._data
52
+
53
+ @property
54
+ def train(self) -> TrainingAPI:
39
55
  """
40
- The train submodule gives access to functionality for training and validating ML models.
56
+ The train submodule gives access to functionality for training and validating ML models.
41
57
  """
42
- return TrainingAPI(self)
58
+ if self._train is None:
59
+ self._train = TrainingAPI(self)
60
+ return self._train
43
61
 
44
62
  @property
45
- def poet(self):
63
+ def align(self) -> AlignAPI:
46
64
  """
47
65
  The PoET submodule gives access to the PoET generative model and MSA and prompt creation interfaces.
48
66
  """
49
- return PoetAPI(self)
50
-
67
+ if self._align is None:
68
+ self._align = AlignAPI(self)
69
+ return self._align
70
+
51
71
  @property
52
- def embedding(self):
72
+ def embedding(self) -> EmbeddingAPI:
53
73
  """
54
74
  The embedding submodule gives access to protein embedding models and their inference endpoints.
55
75
  """
56
- return EmbeddingAPI(self)
76
+ if self._embedding is None:
77
+ self._embedding = EmbeddingAPI(self)
78
+ return self._embedding
57
79
 
58
- @property
59
- def predict(self):
60
- """
61
- The predict submodule gives access to sequence predictions using models from train.
62
- """
63
- return PredictAPI(self)
64
-
65
80
  @property
66
- def design(self):
81
+ def design(self) -> DesignAPI:
67
82
  """
68
- The design submodule gives access to functionality for designing new sequences using models from train.
83
+ The design submodule gives access to functionality for designing new sequences using models from train.
69
84
  """
70
- return DesignAPI(self)
85
+ if self._design is None:
86
+ self._design = DesignAPI(self)
87
+ return self._design
71
88
 
72
-
73
89
  @property
74
- def fold(self):
90
+ def fold(self) -> FoldAPI:
75
91
  """
76
- The fold submodule gives access to functionality for folding sequences and returning PDBs.
92
+ The fold submodule gives access to functionality for folding sequences and returning PDBs.
77
93
  """
78
- return FoldAPI(self)
79
-
94
+ if self._fold is None:
95
+ self._fold = FoldAPI(self)
96
+ return self._fold
97
+
80
98
 
81
99
  connect = OpenProtein
@@ -2,6 +2,6 @@ from . import data
2
2
  from . import design
3
3
  from . import train
4
4
  from . import predict
5
- from . import poet
5
+ from . import align
6
6
  from . import embedding
7
7
  from . import fold