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

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.22
3
+ Version: 0.0.23
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -35,13 +35,13 @@ pkgs/strenum_compat/__init__.py,sha256=wXRFeNvBm8RU6dy1PFJ5sRLgUIEeH_DVR95Sv5qpG
35
35
  pkgs/strenum_compat/strenum_compat.py,sha256=uOUAgpYTjHs1MX8dG81jRlyTkt3KNbkV_25zp7xTX2s,36
36
36
  pkgs/type_spec/__init__.py,sha256=h5DmJTca4QVV10sZR1x0-MlkZfuGYDfapR3zHvXfzto,19
37
37
  pkgs/type_spec/__main__.py,sha256=5bJaX9Y_-FavP0qwzhk-z-V97UY7uaezJTa1zhO_HHQ,1048
38
- pkgs/type_spec/builder.py,sha256=kLiTjVVbtctRfSStI15IZYbyQ4n2KPmvtJIWbizux40,43002
38
+ pkgs/type_spec/builder.py,sha256=9fEcZkasqovH8W4PtQvXtPu4psS_a-HAyu6Wsfk5L8w,43041
39
39
  pkgs/type_spec/config.py,sha256=INfEiDcUsZFUKasHprsE6i33siPB0RnfmTKOsWcGnQ8,5043
40
- pkgs/type_spec/emit_io_ts.py,sha256=gCEfS81w_ifqjLVJ3_cpy9Gq03o6H5nEsh35WAkqGGE,5606
41
- pkgs/type_spec/emit_open_api.py,sha256=xy-nXjkqAZMDd-0qU5eDubRz1Hf8IwZSZj5bZyPSvX4,23328
40
+ pkgs/type_spec/emit_io_ts.py,sha256=Ghd8XYqyNYldHQDepwa9GLfHXcoi48ztBw84K28ETic,5707
41
+ pkgs/type_spec/emit_open_api.py,sha256=RJzzOZ7Ti1PNTPn42ZGW7OA6L9KRQhKOTw4elXzJKpE,23524
42
42
  pkgs/type_spec/emit_open_api_util.py,sha256=F6qouGVm2-WGYkoubbBtRu00V4e30bWJ0fDBhigBEfg,2248
43
- pkgs/type_spec/emit_python.py,sha256=hj_5RUnJzjI6W9SmOh8ZUJTWB6F7PB1UFsg3OGSXZg0,42416
44
- pkgs/type_spec/emit_typescript.py,sha256=KOCcPuwSLRSt3pIp06Nq9exledq-kWtrA4RnUpeGMi8,17505
43
+ pkgs/type_spec/emit_python.py,sha256=aGPnp86DZN0N7c5eiBHVAT_smDf1uCLmRldDhxmWx9g,42673
44
+ pkgs/type_spec/emit_typescript.py,sha256=4hpCJwiDf-v8LJaNFVfFtf8zvtG73YNPFwwa_5NuffI,17729
45
45
  pkgs/type_spec/emit_typescript_util.py,sha256=93FzJnpYse4PKFzgdw4DGV4zFTi5tF4WR-CIi7cW498,873
46
46
  pkgs/type_spec/load_types.py,sha256=xEHwdB_miR3vNs161Oy1luafE0VC-yk9-utAyCJmbEo,3629
47
47
  pkgs/type_spec/open_api_util.py,sha256=TFbK2bkYT6S4qPQGO3_G2mfVgtNB26d31kwaHQ9y99E,6730
@@ -90,7 +90,7 @@ type_spec/external/api/recipes/associate_recipe_as_lot.yaml,sha256=8wzeJg5njt4qG
90
90
  type_spec/external/api/recipes/create_recipe.yaml,sha256=mGLyKJI3pN_7nU4rcSqCO3WjuKhO_odZ2pewVgYcMUU,1322
91
91
  type_spec/external/api/recipes/create_recipes.yaml,sha256=eXMlXRpB5TFt1mUTECBa4aAIG3KrxYT2mJ5vxmZ9Q3A,1503
92
92
  type_spec/external/api/recipes/disassociate_recipe_as_input.yaml,sha256=qTKQCNBNwLnbr22DQVLA6b80BdBhwnDbX1c4KoCKUm8,477
93
- type_spec/external/api/recipes/edit_recipe_inputs.yaml,sha256=mmRcep8It4UIUmABtLKxwH5fuax_9yb0vvF8_6ROLjY,2591
93
+ type_spec/external/api/recipes/edit_recipe_inputs.yaml,sha256=ljewBw77ucvl_m_KWmSJp-nVQGvVG6cb7xVOgPIlueU,2573
94
94
  type_spec/external/api/recipes/get_curve.yaml,sha256=zQpPwOYqojY-YwmTjbqoGtUxpYm3vne2sYpglWbPnpw,779
95
95
  type_spec/external/api/recipes/get_recipe_calculations.yaml,sha256=ZE7PzfWrjS7TiO4q7iyCwEj5In8GwO6fFIYGqUlTEXo,1240
96
96
  type_spec/external/api/recipes/get_recipe_links.yaml,sha256=Vwm0OVWl3VvDaI7chY_oZQqD8xZ1u09iFWKkZKn1ITo,766
@@ -126,7 +126,7 @@ uncountable/types/async_batch_processor.py,sha256=YksvTyJaZ3rqpZx4UXofUf7XU1Br4a
126
126
  uncountable/types/base.py,sha256=w3BRf8SAvYPlKrcJtJcQ_WhCU3A9zy0VuRTRWRFKVUA,2709
127
127
  uncountable/types/calculations.py,sha256=16J-KKMp-I8ZQUkYNmKCHfAn6DGb99cFinALcDIdGHY,562
128
128
  uncountable/types/chemical_structure.py,sha256=zQKl53DGtQQONIUHFXuwjWLQaG7FPZY7x6SBSOzkGV0,758
129
- uncountable/types/client_base.py,sha256=eAgmDRoHhpsswgqI1q8-eg8joya7qaaFJKH1fyE50PE,46075
129
+ uncountable/types/client_base.py,sha256=nsV7NWN5UoqjCfFSw9XLXT_rbpfZeWRrOLxqeZ20Sjw,47114
130
130
  uncountable/types/curves.py,sha256=qYyRntMmFNonEwTrGhquMLbgMqjyP1moQflNTP0FMec,1308
131
131
  uncountable/types/entity.py,sha256=NjMZrqBwQ7sZe_oUuJqy9IEG7dWZmFMkQQXJ0_odcnA,11637
132
132
  uncountable/types/experiment_groups.py,sha256=ZBEk06F4n98Jz3oEA09WaDmw5rqPs7iVAm_Ysr4gc_o,599
@@ -208,7 +208,7 @@ uncountable/types/api/recipes/set_recipe_outputs.py,sha256=QYq39TNchQ80ET1C77OE9
208
208
  uncountable/types/api/recipes/set_recipe_tags.py,sha256=U710hgq9-t6QZGRB-ZGHskpt4iXwYEjIRb67eh3P518,2453
209
209
  uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
210
210
  uncountable/types/api/triggers/run_trigger.py,sha256=9m9M8-nlGB_sAU2Qm2lWugp4h4Osqj6QpjNfU8osd1U,901
211
- UncountablePythonSDK-0.0.22.dist-info/METADATA,sha256=o1sddgkTqesJ-3NQ_fm1xSgW1vj8bV-PAXnFW7g6-Hs,1613
212
- UncountablePythonSDK-0.0.22.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
213
- UncountablePythonSDK-0.0.22.dist-info/top_level.txt,sha256=HaMiBnH1wA7SG9-RVHIJPBH3l8X5gee2jUf-77Nz-Dk,41
214
- UncountablePythonSDK-0.0.22.dist-info/RECORD,,
211
+ UncountablePythonSDK-0.0.23.dist-info/METADATA,sha256=W6CHPkwSSSiPK9zlnXFS8WjX7sCL8o2-76dd4m2CJkY,1613
212
+ UncountablePythonSDK-0.0.23.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
213
+ UncountablePythonSDK-0.0.23.dist-info/top_level.txt,sha256=HaMiBnH1wA7SG9-RVHIJPBH3l8X5gee2jUf-77Nz-Dk,41
214
+ UncountablePythonSDK-0.0.23.dist-info/RECORD,,
pkgs/type_spec/builder.py CHANGED
@@ -86,6 +86,7 @@ class BaseTypeName(StrEnum):
86
86
  s_optional = "Optional"
87
87
  s_string = "String"
88
88
  s_tuple = "Tuple"
89
+ s_readonly_array = "ReadonlyArray"
89
90
  s_union = "Union"
90
91
 
91
92
  # For a root class that defines properties
@@ -118,7 +118,10 @@ def refer_to_io_ts(
118
118
  stype: builder.SpecType,
119
119
  ) -> str:
120
120
  if isinstance(stype, builder.SpecTypeInstance):
121
- if stype.defn_type.name == builder.BaseTypeName.s_list:
121
+ if (
122
+ stype.defn_type.name == builder.BaseTypeName.s_list
123
+ or stype.defn_type.name == builder.BaseTypeName.s_readonly_array
124
+ ):
122
125
  spec = refer_to_io_ts(ctx, stype.parameters[0])
123
126
  return f"IO.array({spec})"
124
127
  if stype.defn_type.name == builder.BaseTypeName.s_union:
@@ -634,6 +634,10 @@ def open_api_type(
634
634
  [open_api_type(ctx, p, config=config) for p in stype.parameters],
635
635
  description="TupleType",
636
636
  )
637
+ if stype.defn_type.name == builder.BaseTypeName.s_readonly_array:
638
+ return OpenAPIArrayType(
639
+ open_api_type(ctx, stype.parameters[0], config=config)
640
+ )
637
641
 
638
642
  # TODO: generics are not supported by OpenAPI
639
643
  # map to Free-Form Object and add description
@@ -819,6 +819,7 @@ base_name_map = {
819
819
  builder.BaseTypeName.s_opaque_key: "OpaqueKey",
820
820
  builder.BaseTypeName.s_string: "str",
821
821
  builder.BaseTypeName.s_tuple: "tuple",
822
+ builder.BaseTypeName.s_readonly_array: "tuple",
822
823
  builder.BaseTypeName.s_union: "typing.Union",
823
824
  builder.BaseTypeName.s_literal: "typing.Literal",
824
825
  }
@@ -827,6 +828,11 @@ base_name_map = {
827
828
  def refer_to(ctx: TrackingContext, stype: builder.SpecType) -> str:
828
829
  if isinstance(stype, builder.SpecTypeInstance):
829
830
  params = ", ".join([refer_to(ctx, p) for p in stype.parameters])
831
+
832
+ if stype.defn_type.is_base_type(builder.BaseTypeName.s_readonly_array):
833
+ assert len(stype.parameters) == 1, "Read Only Array takes one parameter"
834
+ params = f"{params}, ..."
835
+
830
836
  return f"{refer_to(ctx, stype.defn_type)}[{params}]"
831
837
 
832
838
  if isinstance(stype, builder.SpecTypeLiteralWrapper):
@@ -394,6 +394,9 @@ def refer_to_impl(
394
394
  if stype.defn_type.name == builder.BaseTypeName.s_list:
395
395
  spec, multi = refer_to_impl(ctx, stype.parameters[0])
396
396
  return f"({spec})[]" if multi else f"{spec}[]", False
397
+ if stype.defn_type.name == builder.BaseTypeName.s_readonly_array:
398
+ spec, multi = refer_to_impl(ctx, stype.parameters[0])
399
+ return f"readonly ({spec})[]" if multi else f"readonly {spec}[]", False
397
400
  if stype.defn_type.name == builder.BaseTypeName.s_union:
398
401
  return f'({" | ".join([refer_to(ctx, p) for p in stype.parameters])})', False
399
402
  if stype.defn_type.name == builder.BaseTypeName.s_literal:
@@ -1,6 +1,5 @@
1
1
  $endpoint:
2
2
  is_sdk: true
3
- is_beta: true
4
3
  async_batch_path: edit_recipe_inputs
5
4
  method: post
6
5
  path: ${external}/recipes/edit_recipe_inputs
@@ -21,6 +21,7 @@ import uncountable.types.api.recipes.create_recipe as create_recipe_t
21
21
  import uncountable.types.api.recipe_links.create_recipe_link as create_recipe_link_t
22
22
  import uncountable.types.api.recipes.create_recipes as create_recipes_t
23
23
  import uncountable.types.api.recipes.disassociate_recipe_as_input as disassociate_recipe_as_input_t
24
+ import uncountable.types.api.recipes.edit_recipe_inputs as edit_recipe_inputs_t
24
25
  from uncountable.types import entity as entity_t
25
26
  import uncountable.types.api.batch.execute_batch as execute_batch_t
26
27
  import uncountable.types.api.batch.execute_batch_load_async as execute_batch_load_async_t
@@ -51,6 +52,7 @@ from uncountable.types import post_base as post_base_t
51
52
  from uncountable.types import recipe_identifiers as recipe_identifiers_t
52
53
  from uncountable.types import recipe_links as recipe_links_t
53
54
  from uncountable.types import recipe_metadata as recipe_metadata_t
55
+ from uncountable.types import recipe_workflow_steps as recipe_workflow_steps_t
54
56
  import uncountable.types.api.entity.resolve_entity_ids as resolve_entity_ids_t
55
57
  import uncountable.types.api.outputs.resolve_output_conditions as resolve_output_conditions_t
56
58
  import uncountable.types.api.triggers.run_trigger as run_trigger_t
@@ -319,6 +321,29 @@ class ClientMethods(ABC):
319
321
  )
320
322
  return self.do_request(api_request=api_request, return_type=disassociate_recipe_as_input_t.Data)
321
323
 
324
+ def edit_recipe_inputs(
325
+ self,
326
+ *,
327
+ recipe_key: identifier_t.IdentifierKey,
328
+ recipe_workflow_step_identifier: recipe_workflow_steps_t.RecipeWorkflowStepIdentifier,
329
+ edits: list[edit_recipe_inputs_t.RecipeInputEdit],
330
+ ) -> edit_recipe_inputs_t.Data:
331
+ """Clear, update, or add inputs on a recipe
332
+
333
+ :param recipe_key: Identifier for the recipe
334
+ """
335
+ args = edit_recipe_inputs_t.Arguments(
336
+ recipe_key=recipe_key,
337
+ recipe_workflow_step_identifier=recipe_workflow_step_identifier,
338
+ edits=edits,
339
+ )
340
+ api_request = APIRequest(
341
+ method=edit_recipe_inputs_t.ENDPOINT_METHOD,
342
+ endpoint=edit_recipe_inputs_t.ENDPOINT_PATH,
343
+ args=args,
344
+ )
345
+ return self.do_request(api_request=api_request, return_type=edit_recipe_inputs_t.Data)
346
+
322
347
  def execute_batch(
323
348
  self,
324
349
  *,