UncountablePythonSDK 0.0.15__py3-none-any.whl → 0.0.17__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.

Potentially problematic release.


This version of UncountablePythonSDK might be problematic. Click here for more details.

Files changed (57) hide show
  1. {UncountablePythonSDK-0.0.15.dist-info → UncountablePythonSDK-0.0.17.dist-info}/METADATA +14 -1
  2. {UncountablePythonSDK-0.0.15.dist-info → UncountablePythonSDK-0.0.17.dist-info}/RECORD +57 -20
  3. {UncountablePythonSDK-0.0.15.dist-info → UncountablePythonSDK-0.0.17.dist-info}/top_level.txt +1 -0
  4. docs/.gitignore +1 -0
  5. docs/conf.py +52 -0
  6. docs/index.md +13 -0
  7. docs/justfile +12 -0
  8. docs/quickstart.md +19 -0
  9. docs/requirements.txt +7 -0
  10. docs/static/favicons/android-chrome-192x192.png +0 -0
  11. docs/static/favicons/android-chrome-512x512.png +0 -0
  12. docs/static/favicons/apple-touch-icon.png +0 -0
  13. docs/static/favicons/browserconfig.xml +9 -0
  14. docs/static/favicons/favicon-16x16.png +0 -0
  15. docs/static/favicons/favicon-32x32.png +0 -0
  16. docs/static/favicons/manifest.json +18 -0
  17. docs/static/favicons/mstile-150x150.png +0 -0
  18. docs/static/favicons/safari-pinned-tab.svg +32 -0
  19. docs/static/logo_blue.png +0 -0
  20. examples/create_entity.py +23 -16
  21. pkgs/argument_parser/argument_parser.py +13 -6
  22. pkgs/type_spec/actions_registry/__init__.py +0 -0
  23. pkgs/type_spec/actions_registry/__main__.py +108 -0
  24. pkgs/type_spec/actions_registry/emit_typescript.py +106 -0
  25. pkgs/type_spec/builder.py +4 -0
  26. pkgs/type_spec/emit_python.py +35 -1
  27. pkgs/type_spec/emit_typescript.py +6 -7
  28. pkgs/type_spec/value_spec/emit_python.py +1 -0
  29. type_spec/external/api/chemical/convert_chemical_formats.yaml +33 -0
  30. type_spec/external/api/entity/create_entities.yaml +1 -1
  31. type_spec/external/api/entity/create_entity.yaml +1 -1
  32. type_spec/external/api/recipe_links/create_recipe_link.yaml +25 -0
  33. type_spec/external/api/recipes/associate_recipe_as_input.yaml +19 -0
  34. type_spec/external/api/recipes/associate_recipe_as_lot.yaml +19 -0
  35. type_spec/external/api/recipes/create_recipe.yaml +35 -0
  36. type_spec/external/api/recipes/set_recipe_inputs.yaml +3 -0
  37. type_spec/external/api/recipes/set_recipe_metadata.yaml +19 -0
  38. uncountable/core/client.py +13 -14
  39. uncountable/integration/executors/script_executor.py +7 -6
  40. uncountable/types/__init__.py +20 -0
  41. uncountable/types/api/chemical/__init__.py +1 -0
  42. uncountable/types/api/chemical/convert_chemical_formats.py +50 -0
  43. uncountable/types/api/entity/create_entities.py +1 -1
  44. uncountable/types/api/entity/create_entity.py +1 -1
  45. uncountable/types/api/recipe_links/__init__.py +1 -0
  46. uncountable/types/api/recipe_links/create_recipe_link.py +39 -0
  47. uncountable/types/api/recipes/associate_recipe_as_input.py +35 -0
  48. uncountable/types/api/recipes/associate_recipe_as_lot.py +36 -0
  49. uncountable/types/api/recipes/create_recipe.py +41 -0
  50. uncountable/types/api/recipes/set_recipe_inputs.py +1 -0
  51. uncountable/types/api/recipes/set_recipe_metadata.py +36 -0
  52. uncountable/types/async_batch.py +23 -0
  53. uncountable/types/chemical_structure.py +27 -0
  54. uncountable/types/client_base.py +303 -2
  55. uncountable/types/identifier.py +54 -0
  56. uncountable/types/recipe_identifiers.py +62 -0
  57. {UncountablePythonSDK-0.0.15.dist-info → UncountablePythonSDK-0.0.17.dist-info}/WHEEL +0 -0
@@ -9,10 +9,15 @@ import typing # noqa: F401
9
9
  import datetime # noqa: F401
10
10
  from decimal import Decimal # noqa: F401
11
11
  from pkgs.serialization import OpaqueKey
12
+ import uncountable.types.api.recipes.associate_recipe_as_input as associate_recipe_as_input_t
13
+ import uncountable.types.api.recipes.associate_recipe_as_lot as associate_recipe_as_lot_t
12
14
  from . import base as base_t
15
+ import uncountable.types.api.chemical.convert_chemical_formats as convert_chemical_formats_t
13
16
  import uncountable.types.api.entity.create_entities as create_entities_t
14
17
  import uncountable.types.api.entity.create_entity as create_entity_t
15
18
  import uncountable.types.api.inputs.create_inputs as create_inputs_t
19
+ import uncountable.types.api.recipes.create_recipe as create_recipe_t
20
+ import uncountable.types.api.recipe_links.create_recipe_link as create_recipe_link_t
16
21
  import uncountable.types.api.recipes.create_recipes as create_recipes_t
17
22
  from . import entity as entity_t
18
23
  import uncountable.types.api.batch.execute_batch as execute_batch_t
@@ -33,12 +38,16 @@ import uncountable.types.api.recipe_metadata.get_recipe_metadata_data as get_rec
33
38
  import uncountable.types.api.recipes.get_recipe_names as get_recipe_names_t
34
39
  import uncountable.types.api.recipes.get_recipe_output_metadata as get_recipe_output_metadata_t
35
40
  import uncountable.types.api.recipes.get_recipes_data as get_recipes_data_t
41
+ from . import identifier as identifier_t
36
42
  import uncountable.types.api.entity.list_entities as list_entities_t
43
+ from . import recipe_identifiers as recipe_identifiers_t
37
44
  from . import recipe_links as recipe_links_t
45
+ from . import recipe_metadata as recipe_metadata_t
38
46
  import uncountable.types.api.entity.resolve_entity_ids as resolve_entity_ids_t
39
47
  import uncountable.types.api.outputs.resolve_output_conditions as resolve_output_conditions_t
40
48
  import uncountable.types.api.inputs.set_input_attribute_values as set_input_attribute_values_t
41
49
  import uncountable.types.api.recipes.set_recipe_inputs as set_recipe_inputs_t
50
+ import uncountable.types.api.recipes.set_recipe_metadata as set_recipe_metadata_t
42
51
  import uncountable.types.api.recipes.set_recipe_outputs as set_recipe_outputs_t
43
52
  import uncountable.types.api.entity.set_values as set_values_t
44
53
  from abc import ABC, abstractmethod
@@ -61,13 +70,81 @@ class ClientMethods(ABC):
61
70
  ...
62
71
 
63
72
 
73
+ def associate_recipe_as_input(
74
+ self,
75
+ *,
76
+ recipe_key: identifier_t.IdentifierKey,
77
+ ) -> associate_recipe_as_input_t.Data:
78
+ """Create or return the input association for a recipe
79
+
80
+ :param recipe_key: Identifier for the recipe
81
+ """
82
+ args = associate_recipe_as_input_t.Arguments(
83
+ recipe_key=recipe_key,
84
+ )
85
+ api_request = APIRequest(
86
+ method=associate_recipe_as_input_t.ENDPOINT_METHOD,
87
+ endpoint=associate_recipe_as_input_t.ENDPOINT_PATH,
88
+ args=args,
89
+ )
90
+ return self.do_request(api_request=api_request, return_type=associate_recipe_as_input_t.Data)
91
+
92
+
93
+ def associate_recipe_as_lot(
94
+ self,
95
+ *,
96
+ recipe_key: identifier_t.IdentifierKey,
97
+ ingredient_key: identifier_t.IdentifierKey,
98
+ ) -> associate_recipe_as_lot_t.Data:
99
+ """Create a new lot association for the provided recipe with the provided ingredient
100
+
101
+ :param recipe_key: Identifier for the recipe
102
+ :param ingredient_key: Identifier for the ingredient
103
+ """
104
+ args = associate_recipe_as_lot_t.Arguments(
105
+ recipe_key=recipe_key,
106
+ ingredient_key=ingredient_key,
107
+ )
108
+ api_request = APIRequest(
109
+ method=associate_recipe_as_lot_t.ENDPOINT_METHOD,
110
+ endpoint=associate_recipe_as_lot_t.ENDPOINT_PATH,
111
+ args=args,
112
+ )
113
+ return self.do_request(api_request=api_request, return_type=associate_recipe_as_lot_t.Data)
114
+
115
+
116
+ def convert_chemical_formats(
117
+ self,
118
+ *,
119
+ source_chemical_structures: list[convert_chemical_formats_t.ChemicalStructureFile],
120
+ ) -> convert_chemical_formats_t.Data:
121
+ """Converts chemical formats, into the format used by Uncountable and usable in other APIs for eg. set_input_attribute_values
122
+
123
+ """
124
+ args = convert_chemical_formats_t.Arguments(
125
+ source_chemical_structures=source_chemical_structures,
126
+ )
127
+ api_request = APIRequest(
128
+ method=convert_chemical_formats_t.ENDPOINT_METHOD,
129
+ endpoint=convert_chemical_formats_t.ENDPOINT_PATH,
130
+ args=args,
131
+ )
132
+ return self.do_request(api_request=api_request, return_type=convert_chemical_formats_t.Data)
133
+
134
+
64
135
  def create_entities(
65
136
  self,
66
137
  *,
67
138
  definition_id: base_t.ObjectId,
68
- entity_type: typing.Union[typing.Literal[entity_t.EntityType.LAB_REQUEST], typing.Literal[entity_t.EntityType.APPROVAL], typing.Literal[entity_t.EntityType.CUSTOM_ENTITY], typing.Literal[entity_t.EntityType.TASK], typing.Literal[entity_t.EntityType.PROJECT]],
139
+ entity_type: typing.Union[typing.Literal[entity_t.EntityType.LAB_REQUEST], typing.Literal[entity_t.EntityType.APPROVAL], typing.Literal[entity_t.EntityType.CUSTOM_ENTITY], typing.Literal[entity_t.EntityType.TASK], typing.Literal[entity_t.EntityType.PROJECT], typing.Literal[entity_t.EntityType.EQUIPMENT], typing.Literal[entity_t.EntityType.INV_LOCAL_LOCATIONS]],
69
140
  entities_to_create: list[create_entities_t.EntityToCreate],
70
141
  ) -> create_entities_t.Data:
142
+ """Creates new Uncountable entities
143
+
144
+ :param definition_id: Definition id for the entities to create
145
+ :param entity_type: The type of the entities to create
146
+ :param entities_to_create: A list of the entities to create
147
+ """
71
148
  args = create_entities_t.Arguments(
72
149
  definition_id=definition_id,
73
150
  entity_type=entity_type,
@@ -85,9 +162,14 @@ class ClientMethods(ABC):
85
162
  self,
86
163
  *,
87
164
  definition_id: base_t.ObjectId,
88
- entity_type: typing.Union[typing.Literal[entity_t.EntityType.LAB_REQUEST], typing.Literal[entity_t.EntityType.APPROVAL], typing.Literal[entity_t.EntityType.CUSTOM_ENTITY], typing.Literal[entity_t.EntityType.TASK], typing.Literal[entity_t.EntityType.PROJECT]],
165
+ entity_type: typing.Union[typing.Literal[entity_t.EntityType.LAB_REQUEST], typing.Literal[entity_t.EntityType.APPROVAL], typing.Literal[entity_t.EntityType.CUSTOM_ENTITY], typing.Literal[entity_t.EntityType.TASK], typing.Literal[entity_t.EntityType.PROJECT], typing.Literal[entity_t.EntityType.EQUIPMENT], typing.Literal[entity_t.EntityType.INV_LOCAL_LOCATIONS]],
89
166
  field_values: typing.Optional[typing.Optional[list[field_values_t.FieldRefNameValue]]] = None,
90
167
  ) -> create_entity_t.Data:
168
+ """Creates a new Uncountable entity
169
+
170
+ :param definition_id: Definition id of the entity to create
171
+ :param entity_type: The type of the entities requested
172
+ """
91
173
  args = create_entity_t.Arguments(
92
174
  definition_id=definition_id,
93
175
  entity_type=entity_type,
@@ -106,6 +188,10 @@ class ClientMethods(ABC):
106
188
  *,
107
189
  inputs_to_create: list[create_inputs_t.InputToCreate],
108
190
  ) -> create_inputs_t.Data:
191
+ """Creates new inputs
192
+
193
+ :param inputs_to_create: A list of inputs to create
194
+ """
109
195
  args = create_inputs_t.Arguments(
110
196
  inputs_to_create=inputs_to_create,
111
197
  )
@@ -117,6 +203,70 @@ class ClientMethods(ABC):
117
203
  return self.do_request(api_request=api_request, return_type=create_inputs_t.Data)
118
204
 
119
205
 
206
+ def create_recipe(
207
+ self,
208
+ *,
209
+ material_family_id: base_t.ObjectId,
210
+ workflow_id: base_t.ObjectId,
211
+ identifiers: recipe_identifiers_t.RecipeIdentifiers,
212
+ name: typing.Optional[str] = None,
213
+ workflow_variant_id: typing.Optional[typing.Optional[base_t.ObjectId]] = None,
214
+ recipe_metadata: typing.Optional[list[recipe_metadata_t.MetadataValue]] = None,
215
+ ) -> create_recipe_t.Data:
216
+ """Returns the id of the recipe being created.
217
+
218
+ :param name: The name for the recipe
219
+ :param material_family_id: The material family for the recipe
220
+ :param workflow_id: The identifier of the workflow to create the recipe with
221
+ :param workflow_variant_id: The identifier of the workflow variant to create the recipe with
222
+ :param recipe_metadata: Metadata values to populate the recipe with
223
+ :param identifiers: A recipe won't be created if it matches the identifier. An identifier must be unique in the schema
224
+ """
225
+ args = create_recipe_t.Arguments(
226
+ name=name,
227
+ material_family_id=material_family_id,
228
+ workflow_id=workflow_id,
229
+ workflow_variant_id=workflow_variant_id,
230
+ recipe_metadata=recipe_metadata,
231
+ identifiers=identifiers,
232
+ )
233
+ api_request = APIRequest(
234
+ method=create_recipe_t.ENDPOINT_METHOD,
235
+ endpoint=create_recipe_t.ENDPOINT_PATH,
236
+ args=args,
237
+ )
238
+ return self.do_request(api_request=api_request, return_type=create_recipe_t.Data)
239
+
240
+
241
+ def create_recipe_link(
242
+ self,
243
+ *,
244
+ recipe_from_key: identifier_t.IdentifierKey,
245
+ recipe_to_key: identifier_t.IdentifierKey,
246
+ link_type: typing.Union[typing.Literal[recipe_links_t.RecipeLinkType.CHILD], typing.Literal[recipe_links_t.RecipeLinkType.CONTROL], typing.Literal[recipe_links_t.RecipeLinkType.USER_LINK]],
247
+ name: str,
248
+ ) -> create_recipe_link_t.Data:
249
+ """Create a link between two recipes. Skip if the link already exists
250
+
251
+ :param recipe_from_key: Identifier for the recipe the link comes from
252
+ :param recipe_to_key: Identifier for the recipe the link goes to
253
+ :param link_type: The type of link being created
254
+ :param name: The name used for the link
255
+ """
256
+ args = create_recipe_link_t.Arguments(
257
+ recipe_from_key=recipe_from_key,
258
+ recipe_to_key=recipe_to_key,
259
+ link_type=link_type,
260
+ name=name,
261
+ )
262
+ api_request = APIRequest(
263
+ method=create_recipe_link_t.ENDPOINT_METHOD,
264
+ endpoint=create_recipe_link_t.ENDPOINT_PATH,
265
+ args=args,
266
+ )
267
+ return self.do_request(api_request=api_request, return_type=create_recipe_link_t.Data)
268
+
269
+
120
270
  def create_recipes(
121
271
  self,
122
272
  *,
@@ -124,6 +274,11 @@ class ClientMethods(ABC):
124
274
  recipe_definitions: list[create_recipes_t.CreateRecipeDefinition],
125
275
  project_id: typing.Optional[base_t.ObjectId] = None,
126
276
  ) -> create_recipes_t.Data:
277
+ """Sets inputs values for an experiment. Values set can be numeric, text or categorical types in the Uncountable system
278
+
279
+ :param material_family_id: The identifier of the material family to create the recipes in
280
+ :param project_id: The identifier of the project to create the recipes in
281
+ """
127
282
  args = create_recipes_t.Arguments(
128
283
  material_family_id=material_family_id,
129
284
  project_id=project_id,
@@ -142,6 +297,9 @@ class ClientMethods(ABC):
142
297
  *,
143
298
  requests: list[execute_batch_t.BatchRequest],
144
299
  ) -> execute_batch_t.Data:
300
+ """Run multiple API calls via one request
301
+
302
+ """
145
303
  args = execute_batch_t.Arguments(
146
304
  requests=requests,
147
305
  )
@@ -158,6 +316,10 @@ class ClientMethods(ABC):
158
316
  *,
159
317
  recipe_output_id: base_t.ObjectId,
160
318
  ) -> get_curve_t.Data:
319
+ """Returns an array of values for the specified curve id.
320
+
321
+ :param recipe_output_id: The recipe output ID to fetch the curve for. This must be a curve recipe output. Recipe Outputs can be found from external_get_recipes_data
322
+ """
161
323
  args = get_curve_t.Arguments(
162
324
  recipe_output_id=recipe_output_id,
163
325
  )
@@ -175,6 +337,11 @@ class ClientMethods(ABC):
175
337
  entity_ids: list[base_t.ObjectId],
176
338
  entity_type: entity_t.EntityType,
177
339
  ) -> get_entities_data_t.Data:
340
+ """Gets the details for a passed entity
341
+
342
+ :param entity_ids: Ids of the entity to retrieve
343
+ :param entity_type: The type of the entities requested, e.g. lab_request or approval
344
+ """
178
345
  args = get_entities_data_t.Arguments(
179
346
  entity_ids=entity_ids,
180
347
  entity_type=entity_type,
@@ -196,6 +363,14 @@ class ClientMethods(ABC):
196
363
  offset: typing.Optional[typing.Optional[int]] = None,
197
364
  limit: typing.Optional[typing.Optional[int]] = None,
198
365
  ) -> get_input_data_t.Data:
366
+ """Gets the attribute, categorization and other metadata associated with a set of inputs. An input is either an ingredient or process parameter, with metadata and calculations assigned separately
367
+
368
+ :param material_family_id: The material family ID to get the input values from.
369
+ :param input_ids: The input IDs to get the data from. If this is not filled in, all inputs from a material family will be returned (in paginated form).
370
+ :param offset: Used for pagination, where the number of results returned exceeds the limit. Results are always ordered by the input ID
371
+ :param is_parameter: Whether to get parameters or ingredients. By default both are returned. When set to true, only parameters are returned, and when set to false, only ingredients are returned
372
+ :param limit: The maximum number of results to return. By default this is set to 1,000 and it cannot be set higher than 1,000
373
+ """
199
374
  args = get_input_data_t.Arguments(
200
375
  material_family_id=material_family_id,
201
376
  input_ids=input_ids,
@@ -216,6 +391,10 @@ class ClientMethods(ABC):
216
391
  *,
217
392
  material_family_id: base_t.ObjectId,
218
393
  ) -> get_input_group_names_t.Data:
394
+ """Gets the name of all input groups in a material family that either the user created, or are shared to all users.
395
+
396
+ :param material_family_id: Required: The Material Family ID to get the input groups from.
397
+ """
219
398
  args = get_input_group_names_t.Arguments(
220
399
  material_family_id=material_family_id,
221
400
  )
@@ -235,6 +414,13 @@ class ClientMethods(ABC):
235
414
  offset: typing.Optional[typing.Optional[int]] = None,
236
415
  limit: typing.Optional[typing.Optional[int]] = None,
237
416
  ) -> get_input_names_t.Data:
417
+ """Gets the name of all inputs for a material family. An input is either an ingredient or process parameter, with metadata and calculations assigned separately
418
+
419
+ :param material_family_id: The material family ID to get the input values from
420
+ :param offset: Used for pagination, where the number of results returned exceeds the limit. Results are always ordered by the input ID
421
+ :param is_parameter: Whether to get parameters or ingredients. By default both are returned. When set to true, only parameters are returned, and when set to false, only ingredients are returned
422
+ :param limit: The maximum number of results to return. By default this is set to 20,000 and it cannot be set higher than 20,000
423
+ """
238
424
  args = get_input_names_t.Arguments(
239
425
  material_family_id=material_family_id,
240
426
  offset=offset,
@@ -254,6 +440,10 @@ class ClientMethods(ABC):
254
440
  *,
255
441
  input_ids: list[base_t.ObjectId],
256
442
  ) -> get_inputs_data_t.Data:
443
+ """Gets the details for passed input ids
444
+
445
+ :param input_ids: Ids of the inputs to retrieve
446
+ """
257
447
  args = get_inputs_data_t.Arguments(
258
448
  input_ids=input_ids,
259
449
  )
@@ -273,6 +463,13 @@ class ClientMethods(ABC):
273
463
  offset: typing.Optional[int] = None,
274
464
  limit: typing.Optional[int] = None,
275
465
  ) -> get_output_data_t.Data:
466
+ """Gets the attribute, categorization and other metadata associated with a set of outputs
467
+
468
+ :param material_family_id: The material family ID to get the output values from.
469
+ :param output_ids: The output IDs to get the data from. If this is not filled in, all outputs from a material family will be returned (in paginated form).
470
+ :param offset: Used for pagination, where the number of results returned exceeds the limit. Results are always ordered by the output ID
471
+ :param limit: The maximum number of results to return. By default this is set to 1,000 and it cannot be set higher than 1,000
472
+ """
276
473
  args = get_output_data_t.Arguments(
277
474
  material_family_id=material_family_id,
278
475
  output_ids=output_ids,
@@ -294,6 +491,12 @@ class ClientMethods(ABC):
294
491
  offset: typing.Optional[int] = None,
295
492
  limit: typing.Optional[int] = None,
296
493
  ) -> get_output_names_t.Data:
494
+ """Gets the name of all outputs for a material family. An output represents a measurement value of any time (numeric, text, curve, etc). This includes calculations based off of other outputs, such as a calculated change over time
495
+
496
+ :param material_family_id: The material family ID to get the output values from
497
+ :param offset: Used for pagination, where the number of results returned exceeds the limit. Results are always ordered by the output ID
498
+ :param limit: The maximum number of results to return. By default this is set to 20,000 and it cannot be set higher than 20,000
499
+ """
297
500
  args = get_output_names_t.Arguments(
298
501
  material_family_id=material_family_id,
299
502
  offset=offset,
@@ -313,6 +516,11 @@ class ClientMethods(ABC):
313
516
  all_material_families: bool,
314
517
  material_family_id: typing.Optional[base_t.ObjectId],
315
518
  ) -> get_projects_t.Data:
519
+ """Gets either all projects created in the platform, or the projects associated with a material family ID. Projects are where experiments are placed in Uncountable, similar to folders in a directory structure
520
+
521
+ :param all_material_families: Whether to get projects from all material families. Material families are high level groupings of data, usually separated by functional area
522
+ :param material_family_id: The specific material family ID to get projects from. Only fill this in if all_material_families is set to false
523
+ """
316
524
  args = get_projects_t.Arguments(
317
525
  all_material_families=all_material_families,
318
526
  material_family_id=material_family_id,
@@ -332,6 +540,12 @@ class ClientMethods(ABC):
332
540
  offset: typing.Optional[typing.Optional[int]] = None,
333
541
  limit: typing.Optional[typing.Optional[int]] = None,
334
542
  ) -> get_projects_data_t.Data:
543
+ """Gets either all data associated with a set of projects created in the platform. Because Uncountables recipe structure is complex, various data values are exploded out to increase efficiency in parsing, and this page is paginated to prevent too large of return values
544
+
545
+ :param project_ids: The projects to get the data from
546
+ :param offset: Used for pagination. All pagination is done in order of Project ID
547
+ :param limit: The number of data points to return. If not filled in, it will be set to 100, and cannot be set higher than 100
548
+ """
335
549
  args = get_projects_data_t.Arguments(
336
550
  project_ids=project_ids,
337
551
  offset=offset,
@@ -351,6 +565,11 @@ class ClientMethods(ABC):
351
565
  recipe_ids: list[base_t.ObjectId],
352
566
  calculation_ids: typing.Optional[list[base_t.ObjectId]] = None,
353
567
  ) -> get_recipe_calculations_t.Data:
568
+ """Gets the calculations for the passed recipes
569
+
570
+ :param recipe_ids: Ids of the Recipes to retrieve calculations for
571
+ :param calculation_ids: Optionally a list of ids of calculations to retrieve
572
+ """
354
573
  args = get_recipe_calculations_t.Arguments(
355
574
  recipe_ids=recipe_ids,
356
575
  calculation_ids=calculation_ids,
@@ -370,6 +589,12 @@ class ClientMethods(ABC):
370
589
  depth: int = 1,
371
590
  link_types: typing.Optional[list[recipe_links_t.RecipeLinkType]],
372
591
  ) -> get_recipe_links_t.Data:
592
+ """Gets the links for the passed recipes
593
+
594
+ :param recipe_ids: Ids of the Recipes to retrieve links for
595
+ :param depth: How many layers deep to look for links
596
+ :param link_types: Optional filter to only desired link types
597
+ """
373
598
  args = get_recipe_links_t.Arguments(
374
599
  recipe_ids=recipe_ids,
375
600
  depth=depth,
@@ -391,6 +616,13 @@ class ClientMethods(ABC):
391
616
  offset: typing.Optional[typing.Optional[int]] = None,
392
617
  limit: typing.Optional[typing.Optional[int]] = None,
393
618
  ) -> get_recipe_metadata_data_t.Data:
619
+ """Gets the recipe metadata. Recipe metadata is data associated with experiments that is not an input, output or calculation, such as a sample ID.
620
+
621
+ :param material_family_id: The material family ID to get the recipe metadata values from.
622
+ :param recipe_metadata_ids: The recipe metadata IDs to get the data from. If this is not filled in, all metadata from a material family will be returned (in paginated form).
623
+ :param offset: Used for pagination, where the number of results returned exceeds the limit. Results are always ordered by the metadata ID
624
+ :param limit: The maximum number of results to return. By default this is set to 1,000 and it cannot be set higher than 1,000
625
+ """
394
626
  args = get_recipe_metadata_data_t.Arguments(
395
627
  material_family_id=material_family_id,
396
628
  recipe_metadata_ids=recipe_metadata_ids,
@@ -410,6 +642,10 @@ class ClientMethods(ABC):
410
642
  *,
411
643
  project_id: base_t.ObjectId,
412
644
  ) -> get_recipe_names_t.Data:
645
+ """Gets the name of all recipes (or experiments, used as synonyms by Uncountable) for a project. The call external_get_projects can be used to find projects
646
+
647
+ :param project_id: Required: The project ID to get the recipes/experiments from.
648
+ """
413
649
  args = get_recipe_names_t.Arguments(
414
650
  project_id=project_id,
415
651
  )
@@ -426,6 +662,10 @@ class ClientMethods(ABC):
426
662
  *,
427
663
  recipe_output_ids: list[base_t.ObjectId],
428
664
  ) -> get_recipe_output_metadata_t.Data:
665
+ """Gets the metadata values for the passed recipe outputs
666
+
667
+ :param recipe_output_ids: Ids of the Recipe Outputs to retrieve metadata for
668
+ """
429
669
  args = get_recipe_output_metadata_t.Arguments(
430
670
  recipe_output_ids=recipe_output_ids,
431
671
  )
@@ -445,6 +685,13 @@ class ClientMethods(ABC):
445
685
  offset: typing.Optional[typing.Optional[int]] = None,
446
686
  limit: typing.Optional[typing.Optional[int]] = None,
447
687
  ) -> get_recipes_data_t.Data:
688
+ """Gets all data associated with a set of recipes / experiments. Because Uncountables recipe structure is complex, various data values are exploded out to increase efficiency in parsing, and this page is paginated to prevent too large of return values
689
+
690
+ :param recipe_ids: The recipes to get the data from. Either these or project_id must be filled in
691
+ :param project_id: The projects to get the data from. Either these or recipe_ids must be filled in
692
+ :param offset: Used for pagination. All pagination is done in order of Recipe ID
693
+ :param limit: The number of data points to return. If not filled in, it will be set to 100, and cannot be set higher than 100
694
+ """
448
695
  args = get_recipes_data_t.Arguments(
449
696
  recipe_ids=recipe_ids,
450
697
  project_id=project_id,
@@ -468,6 +715,14 @@ class ClientMethods(ABC):
468
715
  offset: typing.Optional[typing.Optional[int]] = None,
469
716
  limit: typing.Optional[typing.Optional[int]] = None,
470
717
  ) -> list_entities_t.Data:
718
+ """Uses a structured loading configuration to list entities in the system
719
+
720
+ :param entity_type: The type of the entities requested, e.g. lab_request, recipe
721
+ :param config_reference: The configuration reference name for the listing config
722
+ :param attributes: Attributes to pass to the configuration for parameterizing filters
723
+ :param offset: Used for pagination. Pagination is done based on the sorting of the config
724
+ :param limit: The number of data points to return. If not filled in, it will be set to 100, and cannot be set higher than 100
725
+ """
471
726
  args = list_entities_t.Arguments(
472
727
  entity_type=entity_type,
473
728
  config_reference=config_reference,
@@ -489,6 +744,11 @@ class ClientMethods(ABC):
489
744
  entity_ids: list[typing.Union[str, base_t.ObjectId]],
490
745
  entity_type: entity_t.EntityType,
491
746
  ) -> resolve_entity_ids_t.Data:
747
+ """Gets the names for passed in ids
748
+
749
+ :param entity_ids: Ids of the entity to retrieve
750
+ :param entity_type: The type of the entities requested
751
+ """
492
752
  args = resolve_entity_ids_t.Arguments(
493
753
  entity_ids=entity_ids,
494
754
  entity_type=entity_type,
@@ -506,6 +766,9 @@ class ClientMethods(ABC):
506
766
  *,
507
767
  requested_conditions: list[resolve_output_conditions_t.ConditionRequest],
508
768
  ) -> resolve_output_conditions_t.Data:
769
+ """For the provided set of condition parameter id and values, returns the existing or newly created output condition id for that value and id pair.
770
+
771
+ """
509
772
  args = resolve_output_conditions_t.Arguments(
510
773
  requested_conditions=requested_conditions,
511
774
  )
@@ -522,6 +785,10 @@ class ClientMethods(ABC):
522
785
  *,
523
786
  attribute_values: list[set_input_attribute_values_t.InputAttributeValue],
524
787
  ) -> set_input_attribute_values_t.Data:
788
+ """Sets attribute values for an input
789
+
790
+ :param attribute_values: The attributes of the input to set
791
+ """
525
792
  args = set_input_attribute_values_t.Arguments(
526
793
  attribute_values=attribute_values,
527
794
  )
@@ -538,6 +805,10 @@ class ClientMethods(ABC):
538
805
  *,
539
806
  input_data: list[set_recipe_inputs_t.RecipeInputValue],
540
807
  ) -> set_recipe_inputs_t.Data:
808
+ """Sets inputs values for an experiment. Values set can be numeric, text or categorical types in the Uncountable system
809
+
810
+ :param input_data: The inputs to set. Must be at most 100 entries long
811
+ """
541
812
  args = set_recipe_inputs_t.Arguments(
542
813
  input_data=input_data,
543
814
  )
@@ -549,11 +820,38 @@ class ClientMethods(ABC):
549
820
  return self.do_request(api_request=api_request, return_type=set_recipe_inputs_t.Data)
550
821
 
551
822
 
823
+ def set_recipe_metadata(
824
+ self,
825
+ *,
826
+ recipe_key: identifier_t.IdentifierKey,
827
+ recipe_metadata: list[recipe_metadata_t.MetadataValue],
828
+ ) -> set_recipe_metadata_t.Data:
829
+ """Set metadata values on a recipe
830
+
831
+ :param recipe_key: Identifier for the recipe
832
+ :param recipe_metadata: Metadata values to populate the recipe with
833
+ """
834
+ args = set_recipe_metadata_t.Arguments(
835
+ recipe_key=recipe_key,
836
+ recipe_metadata=recipe_metadata,
837
+ )
838
+ api_request = APIRequest(
839
+ method=set_recipe_metadata_t.ENDPOINT_METHOD,
840
+ endpoint=set_recipe_metadata_t.ENDPOINT_PATH,
841
+ args=args,
842
+ )
843
+ return self.do_request(api_request=api_request, return_type=set_recipe_metadata_t.Data)
844
+
845
+
552
846
  def set_recipe_outputs(
553
847
  self,
554
848
  *,
555
849
  output_data: list[set_recipe_outputs_t.RecipeOutputValue],
556
850
  ) -> set_recipe_outputs_t.Data:
851
+ """Sets output values for an experiment. Values set can be numeric, text or categorical types in the Uncountable system
852
+
853
+ :param output_data: The outputs to set. Must be at most 100 entries long
854
+ """
557
855
  args = set_recipe_outputs_t.Arguments(
558
856
  output_data=output_data,
559
857
  )
@@ -571,6 +869,9 @@ class ClientMethods(ABC):
571
869
  entity: entity_t.Entity,
572
870
  values: list[field_values_t.ArgumentValueRefName],
573
871
  ) -> set_values_t.Data:
872
+ """Sets field values for an entity
873
+
874
+ """
574
875
  args = set_values_t.Arguments(
575
876
  entity=entity,
576
877
  values=values,
@@ -0,0 +1,54 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
2
+ # flake8: noqa: F821
3
+ # ruff: noqa: E402
4
+ # fmt: off
5
+ # isort: skip_file
6
+ from __future__ import annotations
7
+ import typing # noqa: F401
8
+ import datetime # noqa: F401
9
+ from decimal import Decimal # noqa: F401
10
+ from dataclasses import dataclass
11
+ from pkgs.serialization import serial_class
12
+ from . import base as base_t
13
+
14
+ __all__: list[str] = [
15
+ "IdentifierKey",
16
+ "IdentifierKeyBatchReference",
17
+ "IdentifierKeyId",
18
+ "IdentifierKeyRefName",
19
+ ]
20
+
21
+
22
+ # DO NOT MODIFY -- This file is generated by type_spec
23
+ @serial_class(
24
+ parse_require={"type"},
25
+ )
26
+ @dataclass(kw_only=True)
27
+ class IdentifierKeyId:
28
+ type: typing.Literal["id"] = "id"
29
+ id: base_t.ObjectId
30
+
31
+
32
+ # DO NOT MODIFY -- This file is generated by type_spec
33
+ @serial_class(
34
+ parse_require={"type"},
35
+ )
36
+ @dataclass(kw_only=True)
37
+ class IdentifierKeyRefName:
38
+ type: typing.Literal["ref_name"] = "ref_name"
39
+ ref_name: str
40
+
41
+
42
+ # DO NOT MODIFY -- This file is generated by type_spec
43
+ @serial_class(
44
+ parse_require={"type"},
45
+ )
46
+ @dataclass(kw_only=True)
47
+ class IdentifierKeyBatchReference:
48
+ type: typing.Literal["batch_reference"] = "batch_reference"
49
+ reference: str
50
+
51
+
52
+ # DO NOT MODIFY -- This file is generated by type_spec
53
+ IdentifierKey = typing.Union[IdentifierKeyId, IdentifierKeyBatchReference, IdentifierKeyRefName]
54
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,62 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
2
+ # flake8: noqa: F821
3
+ # ruff: noqa: E402
4
+ # fmt: off
5
+ # isort: skip_file
6
+ from __future__ import annotations
7
+ import typing # noqa: F401
8
+ import datetime # noqa: F401
9
+ from decimal import Decimal # noqa: F401
10
+ from dataclasses import dataclass
11
+ from pkgs.serialization import serial_class
12
+ from . import base as base_t
13
+
14
+ __all__: list[str] = [
15
+ "RecipeIdentifier",
16
+ "RecipeIdentifierEditableName",
17
+ "RecipeIdentifierMaterialFamily",
18
+ "RecipeIdentifierMetadata",
19
+ "RecipeIdentifiers",
20
+ ]
21
+
22
+
23
+ # DO NOT MODIFY -- This file is generated by type_spec
24
+ @serial_class(
25
+ parse_require={"type"},
26
+ )
27
+ @dataclass(kw_only=True)
28
+ class RecipeIdentifierEditableName:
29
+ type: typing.Literal["name"] = "name"
30
+ editable_name: str
31
+
32
+
33
+ # DO NOT MODIFY -- This file is generated by type_spec
34
+ @serial_class(
35
+ to_string_values={"quantity_dec"},
36
+ parse_require={"type"},
37
+ )
38
+ @dataclass(kw_only=True)
39
+ class RecipeIdentifierMetadata:
40
+ type: typing.Literal["metadata"] = "metadata"
41
+ recipe_metadata_id: base_t.ObjectId
42
+ quantity_dec: typing.Optional[Decimal] = None
43
+ quantity_json: typing.Optional[str] = None
44
+
45
+
46
+ # DO NOT MODIFY -- This file is generated by type_spec
47
+ @serial_class(
48
+ parse_require={"type"},
49
+ )
50
+ @dataclass(kw_only=True)
51
+ class RecipeIdentifierMaterialFamily:
52
+ type: typing.Literal["material_family_id"] = "material_family_id"
53
+ material_family_id: base_t.ObjectId
54
+
55
+
56
+ # DO NOT MODIFY -- This file is generated by type_spec
57
+ RecipeIdentifier = typing.Union[RecipeIdentifierEditableName, RecipeIdentifierMetadata, RecipeIdentifierMaterialFamily]
58
+
59
+
60
+ # DO NOT MODIFY -- This file is generated by type_spec
61
+ RecipeIdentifiers = list[RecipeIdentifier]
62
+ # DO NOT MODIFY -- This file is generated by type_spec