55from gemd .entity .base_entity import BaseEntity
66from gemd .entity .link_by_uid import LinkByUID
77
8- from citrine ._utils .functions import format_escaped_url , _pad_positional_args
8+ from citrine ._utils .functions import format_escaped_url
99from citrine ._rest .collection import Collection
1010from citrine ._rest .resource import Resource , ResourceTypeEnum
1111from citrine ._serialization import properties
1212from citrine ._session import Session
13- from citrine ._utils .functions import scrub_none , _data_manager_deprecation_checks
13+ from citrine ._utils .functions import scrub_none
1414from citrine .exceptions import NotFound
1515from citrine .resources .api_error import ApiError
1616from citrine .resources .condition_template import ConditionTemplateCollection
@@ -80,10 +80,6 @@ class Dataset(Resource['Dataset']):
8080 """int: Time the dataset was deleted, in seconds since epoch, if it is deleted."""
8181 public = properties .Optional (properties .Boolean (), 'public' )
8282 """bool: Flag indicating whether the dataset is publicly readable."""
83- project_id = properties .Optional (properties .UUID (), 'project_id' ,
84- serializable = False , deserializable = False )
85- """project_id will be needed here until deprecation is complete.
86- This class property will be removed post deprecation"""
8783 team_id = properties .Optional (properties .UUID (), 'team_id' ,
8884 serializable = False , deserializable = False )
8985 session = properties .Optional (properties .Object (Session ), 'session' ,
@@ -107,7 +103,6 @@ def __init__(self, name: str, *, summary: Optional[str] = None,
107103 self .update_time = None
108104 self .delete_time = None
109105 self .public = None
110- self .project_id = None
111106 self .team_id = None
112107 self .session = None
113108
@@ -118,103 +113,101 @@ def __str__(self):
118113 def property_templates (self ) -> PropertyTemplateCollection :
119114 """Return a resource representing all property templates in this dataset."""
120115 return PropertyTemplateCollection (team_id = self .team_id , dataset_id = self .uid ,
121- session = self .session , project_id = self . project_id )
116+ session = self .session )
122117
123118 @property
124119 def condition_templates (self ) -> ConditionTemplateCollection :
125120 """Return a resource representing all condition templates in this dataset."""
126121 return ConditionTemplateCollection (team_id = self .team_id , dataset_id = self .uid ,
127- session = self .session , project_id = self . project_id )
122+ session = self .session )
128123
129124 @property
130125 def parameter_templates (self ) -> ParameterTemplateCollection :
131126 """Return a resource representing all parameter templates in this dataset."""
132127 return ParameterTemplateCollection (team_id = self .team_id , dataset_id = self .uid ,
133- session = self .session , project_id = self . project_id )
128+ session = self .session )
134129
135130 @property
136131 def material_templates (self ) -> MaterialTemplateCollection :
137132 """Return a resource representing all material templates in this dataset."""
138133 return MaterialTemplateCollection (team_id = self .team_id , dataset_id = self .uid ,
139- session = self .session , project_id = self . project_id )
134+ session = self .session )
140135
141136 @property
142137 def measurement_templates (self ) -> MeasurementTemplateCollection :
143138 """Return a resource representing all measurement templates in this dataset."""
144139 return MeasurementTemplateCollection (team_id = self .team_id , dataset_id = self .uid ,
145- session = self .session , project_id = self . project_id )
140+ session = self .session )
146141
147142 @property
148143 def process_templates (self ) -> ProcessTemplateCollection :
149144 """Return a resource representing all process templates in this dataset."""
150145 return ProcessTemplateCollection (team_id = self .team_id , dataset_id = self .uid ,
151- session = self .session , project_id = self . project_id )
146+ session = self .session )
152147
153148 @property
154149 def process_runs (self ) -> ProcessRunCollection :
155150 """Return a resource representing all process runs in this dataset."""
156151 return ProcessRunCollection (team_id = self .team_id , dataset_id = self .uid ,
157- session = self .session , project_id = self . project_id )
152+ session = self .session )
158153
159154 @property
160155 def measurement_runs (self ) -> MeasurementRunCollection :
161156 """Return a resource representing all measurement runs in this dataset."""
162157 return MeasurementRunCollection (team_id = self .team_id , dataset_id = self .uid ,
163- session = self .session , project_id = self . project_id )
158+ session = self .session )
164159
165160 @property
166161 def material_runs (self ) -> MaterialRunCollection :
167162 """Return a resource representing all material runs in this dataset."""
168163 return MaterialRunCollection (team_id = self .team_id , dataset_id = self .uid ,
169- session = self .session , project_id = self . project_id )
164+ session = self .session )
170165
171166 @property
172167 def ingredient_runs (self ) -> IngredientRunCollection :
173168 """Return a resource representing all ingredient runs in this dataset."""
174169 return IngredientRunCollection (team_id = self .team_id , dataset_id = self .uid ,
175- session = self .session , project_id = self . project_id )
170+ session = self .session )
176171
177172 @property
178173 def process_specs (self ) -> ProcessSpecCollection :
179174 """Return a resource representing all process specs in this dataset."""
180175 return ProcessSpecCollection (team_id = self .team_id , dataset_id = self .uid ,
181- session = self .session , project_id = self . project_id )
176+ session = self .session )
182177
183178 @property
184179 def measurement_specs (self ) -> MeasurementSpecCollection :
185180 """Return a resource representing all measurement specs in this dataset."""
186181 return MeasurementSpecCollection (team_id = self .team_id , dataset_id = self .uid ,
187- session = self .session , project_id = self . project_id )
182+ session = self .session )
188183
189184 @property
190185 def material_specs (self ) -> MaterialSpecCollection :
191186 """Return a resource representing all material specs in this dataset."""
192187 return MaterialSpecCollection (team_id = self .team_id , dataset_id = self .uid ,
193- session = self .session , project_id = self . project_id )
188+ session = self .session )
194189
195190 @property
196191 def ingredient_specs (self ) -> IngredientSpecCollection :
197192 """Return a resource representing all ingredient specs in this dataset."""
198193 return IngredientSpecCollection (team_id = self .team_id , dataset_id = self .uid ,
199- session = self .session , project_id = self . project_id )
194+ session = self .session )
200195
201196 @property
202197 def gemd (self ) -> GEMDResourceCollection :
203198 """Return a resource representing all GEMD objects/templates in this dataset."""
204199 return GEMDResourceCollection (team_id = self .team_id , dataset_id = self .uid ,
205- session = self .session , project_id = self . project_id )
200+ session = self .session )
206201
207202 @property
208203 def files (self ) -> FileCollection :
209204 """Return a resource representing all files in the dataset."""
210- return FileCollection (team_id = self .team_id , dataset_id = self .uid ,
211- session = self .session , project_id = self .project_id )
205+ return FileCollection (team_id = self .team_id , dataset_id = self .uid , session = self .session )
212206
213207 @property
214208 def ingestions (self ) -> IngestionCollection :
215209 """Return a resource representing all files in the dataset."""
216- return IngestionCollection (team_id = self .team_id , dataset_id = self .uid ,
217- session = self .session , project_id = self .project_id )
210+ return IngestionCollection (team_id = self .team_id , dataset_id = self .uid , session = self .session )
218211
219212 def register (self , model : DataConcepts , * , dry_run = False ) -> DataConcepts :
220213 """Register a data model object to the appropriate collection."""
@@ -408,7 +401,7 @@ def gemd_batch_delete(
408401
409402class DatasetCollection (Collection [Dataset ]):
410403 """
411- Represents the collection of all datasets associated with a project .
404+ Represents the collection of all datasets associated with a team .
412405
413406 Parameters
414407 ----------
@@ -422,33 +415,11 @@ class DatasetCollection(Collection[Dataset]):
422415 _individual_key = None
423416 _collection_key = None
424417 _resource = Dataset
418+ _path_template = 'teams/{team_id}/datasets'
425419
426- def __init__ (self ,
427- * args ,
428- session : Session = None ,
429- team_id : UUID = None ,
430- project_id : Optional [UUID ] = None ):
431- # Handle positional arguments for backward compatibility
432- args = _pad_positional_args (args , 2 )
433- self .project_id = project_id or args [0 ]
434- self .session = session or args [1 ]
435- if self .session is None :
436- raise TypeError ("Missing one required argument: session." )
437-
438- self .team_id = _data_manager_deprecation_checks (
439- session = self .session ,
440- project_id = self .project_id ,
441- team_id = team_id ,
442- obj_type = "Datasets" )
443-
444- # After the Data Manager deprecation
445- # this can be a Class Variable using the `teams/...` endpoint
446- @property
447- def _path_template (self ):
448- if self .project_id is None :
449- return f'teams/{ self .team_id } /datasets'
450- else :
451- return f'projects/{ self .project_id } /datasets'
420+ def __init__ (self , * , session : Session , team_id : UUID ):
421+ self .session = session
422+ self .team_id = team_id
452423
453424 def build (self , data : dict ) -> Dataset :
454425 """
@@ -468,7 +439,6 @@ def build(self, data: dict) -> Dataset:
468439 dataset = Dataset .build (data )
469440 dataset .team_id = self .team_id
470441 dataset .session = self .session
471- dataset .project_id = self .project_id
472442 return dataset
473443
474444 def register (self , model : Dataset ) -> Dataset :
0 commit comments