1010import warnings
1111
1212from openprotein ._version import __version__
13- from openprotein .app import (
14- DataAPI ,
15- JobsAPI ,
16- AlignAPI ,
17- PromptAPI ,
18- EmbeddingsAPI ,
19- FoldAPI ,
20- SVDAPI ,
21- UMAPAPI ,
22- PredictorAPI ,
23- DesignAPI ,
24- )
25- from openprotein .app .models import Future
13+ from openprotein .data import DataAPI
14+ from openprotein .errors import DeprecationError
15+ from openprotein .jobs import JobsAPI
16+ from openprotein .align import AlignAPI
17+ from openprotein .prompt import PromptAPI
18+ from openprotein .embeddings import EmbeddingsAPI
19+ from openprotein .fold import FoldAPI
20+ from openprotein .svd import SVDAPI
21+ from openprotein .umap import UMAPAPI
22+ from openprotein .predictor import PredictorAPI
23+ from openprotein .design import DesignAPI
24+ from openprotein .jobs import Future
2625from openprotein .base import APISession
2726
28- if TYPE_CHECKING :
29- from openprotein .app .deprecated import TrainingAPI , DesignAPI
30-
3127
3228class OpenProtein (APISession ):
3329 """
@@ -43,8 +39,7 @@ class OpenProtein(APISession):
4339 _umap = None
4440 _fold = None
4541 _predictor = None
46- _designer = None
47- _deprecated = None
42+ _design = None
4843
4944 def wait (self , future : Future , * args , ** kwargs ):
5045 return future .wait (* args , ** kwargs )
@@ -63,12 +58,6 @@ def data(self) -> DataAPI:
6358 self ._data = DataAPI (self )
6459 return self ._data
6560
66- @property
67- def train (self ):
68- raise AttributeError (
69- "Access to deprecated train module is under the deprecated property, i.e. session.deprecated.train"
70- )
71-
7261 @property
7362 def jobs (self ) -> JobsAPI :
7463 """
@@ -113,7 +102,9 @@ def svd(self) -> SVDAPI:
113102 The embedding submodule gives access to protein embedding models and their inference endpoints.
114103 """
115104 if self ._svd is None :
116- self ._svd = SVDAPI (self , self .embeddings )
105+ self ._svd = SVDAPI (
106+ session = self ,
107+ )
117108 return self ._svd
118109
119110 @property
@@ -122,7 +113,9 @@ def umap(self) -> UMAPAPI:
122113 The embedding submodule gives access to protein embedding models and their inference endpoints.
123114 """
124115 if self ._umap is None :
125- self ._umap = UMAPAPI (self )
116+ self ._umap = UMAPAPI (
117+ session = self ,
118+ )
126119 return self ._umap
127120
128121 @property
@@ -131,17 +124,21 @@ def predictor(self) -> PredictorAPI:
131124 The predictor submodule gives access to training and predicting with predictors built on top of embeddings.
132125 """
133126 if self ._predictor is None :
134- self ._predictor = PredictorAPI (self , self .embeddings , self .svd )
127+ self ._predictor = PredictorAPI (
128+ session = self ,
129+ )
135130 return self ._predictor
136131
137132 @property
138133 def design (self ) -> DesignAPI :
139134 """
140135 The designer submodule gives access to functionality for designing new sequences using models from predictor train.
141136 """
142- if self ._designer is None :
143- self ._designer = DesignAPI (self )
144- return self ._designer
137+ if self ._design is None :
138+ self ._design = DesignAPI (
139+ session = self ,
140+ )
141+ return self ._design
145142
146143 @property
147144 def fold (self ) -> FoldAPI :
@@ -152,45 +149,5 @@ def fold(self) -> FoldAPI:
152149 self ._fold = FoldAPI (self )
153150 return self ._fold
154151
155- @property
156- def deprecated (self ) -> "Deprecated" :
157-
158- if self ._deprecated is None :
159- warnings .warn (
160- "Support for deprecated APIs will be dropped in the future! Read the documentation to migrate to the updated APIs."
161- )
162- self ._deprecated = self .Deprecated (self )
163- return self ._deprecated
164-
165- class Deprecated :
166-
167- _train = None
168- _design = None
169-
170- def __init__ (self , session : APISession ):
171- self .session = session
172-
173- @property
174- def train (self ) -> "TrainingAPI" :
175- """
176- The train submodule gives access to functionality for training and validating ML models.
177- """
178- from openprotein .app .deprecated import TrainingAPI
179-
180- if self ._train is None :
181- self ._train = TrainingAPI (self .session )
182- return self ._train
183-
184- @property
185- def design (self ) -> "DesignAPI" :
186- """
187- The design submodule gives access to functionality for designing new sequences using models from train.
188- """
189- from openprotein .app .deprecated import DesignAPI
190-
191- if self ._design is None :
192- self ._design = DesignAPI (self .session )
193- return self ._design
194-
195152
196153connect = OpenProtein
0 commit comments