UncountablePythonSDK 0.0.96__py3-none-any.whl → 0.0.98__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.2
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.96
3
+ Version: 0.0.98
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
@@ -3,7 +3,7 @@ docs/conf.py,sha256=YF5J-9g_Wg8wXmyHsGaE8xYlDEzqocNl3UWUmP0CwBg,1702
3
3
  docs/index.md,sha256=eEdirX_Ds6ICTRtIS5iT4irCquHcQyKN7E4M5QP9T8A,257
4
4
  docs/justfile,sha256=cvNcpb-ByPOF2aCrFlg3DDZBoYMx5W8xGdr13m9HcnI,215
5
5
  docs/quickstart.md,sha256=3GuJ0MB1O5kjlsrgAmdSkDq0rYqATrYy-tzEHDy8H-c,422
6
- docs/requirements.txt,sha256=-sWMwUL2L6vU1QzoQAS-aP8oPbUqXDfMxCeeTKnShFc,138
6
+ docs/requirements.txt,sha256=jyGjzxSfYlDaELlnD_G2PE7wMFV0b3aB_kUaJrC1HRo,153
7
7
  docs/static/logo_blue.png,sha256=SyYpMTVhhBbhF5Wl8lWaVwz-_p1MIR6dW6bVhufQRME,46708
8
8
  docs/static/favicons/android-chrome-192x192.png,sha256=XoF-AhD55JlSBDGsEPJKfT_VeXT-awhwKyZnxLhrwvk,1369
9
9
  docs/static/favicons/android-chrome-512x512.png,sha256=1S4xwY9YtJQ5ifFsZ-DOzssoyBYs0t9uwdOUmYx0Xso,3888
@@ -99,7 +99,7 @@ uncountable/integration/cron.py,sha256=6eH-kIs3sdYPCyb62_L2M7U_uQTdMTdwY5hreEJb0
99
99
  uncountable/integration/entrypoint.py,sha256=BHOYPQgKvZE6HG8Rv15MkdYl8lRkvfDgv1OdLo0oQ9Q,433
100
100
  uncountable/integration/job.py,sha256=zamfyEhtZh0cWyd8DvVq64RlaA1aX_wtOALv6Kf7tyo,2354
101
101
  uncountable/integration/scan_profiles.py,sha256=760zbv7O7wXxHUHqUkFBpd1Afe8hqxMPU3ugwZGdhEo,2925
102
- uncountable/integration/scheduler.py,sha256=jrtktQYGW4QKRLH5GvhOFvCl4S9CLLhWY2GF0rzY-KM,4780
102
+ uncountable/integration/scheduler.py,sha256=99Vq9RBdK_clu4-dS7JtU4aqcxZicG8Njt992if2jK8,4811
103
103
  uncountable/integration/server.py,sha256=m_DYRosGbHuPhygM32Xo-jRBl_oaUhOYsBBD1qwwKh4,4697
104
104
  uncountable/integration/telemetry.py,sha256=QFvvJdzc15CvdaRLFaJeru0OouAFbYdhHYYovbT8bXg,7425
105
105
  uncountable/integration/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -107,7 +107,7 @@ uncountable/integration/db/connect.py,sha256=mE3bdV0huclH2iT_dXCQdRL4LkjIuf_myAR
107
107
  uncountable/integration/db/session.py,sha256=96cGQXpe6IugBTdSsjdP0S5yhJ6toSmbVB6qhc3FJzE,693
108
108
  uncountable/integration/executors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
109
  uncountable/integration/executors/executors.py,sha256=Kzisp1eKufGCWrHIw4mmAj-l1UQ2oJsJR7I-_mksnVs,5441
110
- uncountable/integration/executors/generic_upload_executor.py,sha256=KRUVeQkywIQUxzuzCIp6Vli1JWFelUCKTeJCxjMmkuI,11179
110
+ uncountable/integration/executors/generic_upload_executor.py,sha256=0j3mySzvpy40yu3JEMCeRMaIF2ML8xzNKjHHTGV0-5A,12075
111
111
  uncountable/integration/executors/script_executor.py,sha256=BBQ9f0l7uH2hgKf60jtm-pONzwk-EeOhM2qBAbv_URo,846
112
112
  uncountable/integration/queue_runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
113
113
  uncountable/integration/queue_runner/job_scheduler.py,sha256=2acmeWscG87MZsifxwMRMGJ4sQgQVNJNr5CqIPUg75E,6288
@@ -144,7 +144,7 @@ uncountable/types/calculations.py,sha256=fApOFpgBemt_t7IVneVR0VdI3X5EOxiG6Xhzr6R
144
144
  uncountable/types/calculations_t.py,sha256=LE_HWYPf7yxNTpH5sVPaC0e98OxJ5hUOhHezeJNKDtk,648
145
145
  uncountable/types/chemical_structure.py,sha256=ujyragaD26-QG5jgKnWhO7TN3N1V9b_04T2WhqNYxxo,281
146
146
  uncountable/types/chemical_structure_t.py,sha256=iYmGER_vXqoksv2Nr189qU1Zm70s-U49Eiv0DkWaB1I,773
147
- uncountable/types/client_base.py,sha256=5UJI7ByJitlpoW6ET6AIB14pgzB8zHXTQ0yn291cWmc,68932
147
+ uncountable/types/client_base.py,sha256=o9YGdJS0DikWf-C7N0wTdH-vsUzpgDwGFsCpMyRWC-w,69014
148
148
  uncountable/types/client_config.py,sha256=qLpHt4O_B098CyN6qQajoxZ2zjZ1DILXLUEGyyGP0TQ,280
149
149
  uncountable/types/client_config_t.py,sha256=k_UkjemqiVuJBiFUjJYk3h673Nahr0nGZvfEZFzsC0k,699
150
150
  uncountable/types/curves.py,sha256=QyEyC20jsG-LGKVx6miiF-w70vKMwNkILFBDIJ5Ok9g,345
@@ -261,7 +261,7 @@ uncountable/types/api/project/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8
261
261
  uncountable/types/api/project/get_projects.py,sha256=DHThOC3XesjDPjle3LTW93ef6DTjrVKIK2AZcbv2_s0,1466
262
262
  uncountable/types/api/project/get_projects_data.py,sha256=wp-mL40BNR9I1NXBXYVWlCGxLOFsT2T9B0aoFTYCuZA,1675
263
263
  uncountable/types/api/recipe_links/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
264
- uncountable/types/api/recipe_links/create_recipe_link.py,sha256=Z8WTy6SQPDt2zleRXhKzj2jS-R1QfLnQFg56XVctftQ,1368
264
+ uncountable/types/api/recipe_links/create_recipe_link.py,sha256=xrn7jk1VtCP1Obo-ssWOxrZVvgQHiIPZUKRBueobP4k,1450
265
265
  uncountable/types/api/recipe_links/remove_recipe_link.py,sha256=HZQ15AqPjTqSEJjRY3L9RnU0T2EuzV4Wu7ilbeLhuDI,1354
266
266
  uncountable/types/api/recipe_metadata/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
267
267
  uncountable/types/api/recipe_metadata/get_recipe_metadata_data.py,sha256=fW-6_vBIGa5Wx8JvEdpKb3orXD60DX_wOeHnmMPduc8,1550
@@ -296,7 +296,7 @@ uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr
296
296
  uncountable/types/api/triggers/run_trigger.py,sha256=diX1ix_5hkti1F1uYoZhP5iyc6GHAU5coKgqq5syLhI,1059
297
297
  uncountable/types/api/uploader/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
298
298
  uncountable/types/api/uploader/invoke_uploader.py,sha256=-loZzBihKqx63eP-f5RuV1mu6tgkRTZmIc545kklZLk,1273
299
- UncountablePythonSDK-0.0.96.dist-info/METADATA,sha256=noOdXVOZuFMPGoDTMwFBACEpGQ0lj08XV7gBEefA4ko,2114
300
- UncountablePythonSDK-0.0.96.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
301
- UncountablePythonSDK-0.0.96.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
302
- UncountablePythonSDK-0.0.96.dist-info/RECORD,,
299
+ UncountablePythonSDK-0.0.98.dist-info/METADATA,sha256=du4r_p7s-cbM3pVYNfR0OL55NBFM06ibkgU3wM2x2Dc,2114
300
+ UncountablePythonSDK-0.0.98.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
301
+ UncountablePythonSDK-0.0.98.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
302
+ UncountablePythonSDK-0.0.98.dist-info/RECORD,,
docs/requirements.txt CHANGED
@@ -5,3 +5,4 @@ sphinx-copybutton==0.5.2
5
5
  Sphinx==8.1.3
6
6
  sphinx_design==0.6.1
7
7
  sphinx-favicon==1.0.1
8
+ astroid==3.3.8
@@ -33,6 +33,27 @@ from uncountable.types.job_definition_t import (
33
33
  )
34
34
 
35
35
 
36
+ def _get_extension(filename: str) -> str | None:
37
+ _, ext = os.path.splitext(filename)
38
+ return ext.strip().lower()
39
+
40
+
41
+ def _run_keyword_detection(data: io.BytesIO, keyword: str) -> bool:
42
+ try:
43
+ text = io.TextIOWrapper(data)
44
+ for line in text:
45
+ if (
46
+ keyword in line
47
+ or re.search(keyword, line, flags=re.IGNORECASE) is not None
48
+ ):
49
+ return True
50
+ return False
51
+ except re.error:
52
+ return False
53
+ except UnicodeError:
54
+ return False
55
+
56
+
36
57
  def _filter_files_by_keyword(
37
58
  remote_directory: GenericRemoteDirectoryScope,
38
59
  files: list[FileObjectData],
@@ -41,7 +62,20 @@ def _filter_files_by_keyword(
41
62
  if remote_directory.detection_keyword is None:
42
63
  return files
43
64
 
44
- raise NotImplementedError("keyword detection not implemented yet")
65
+ filtered_files = []
66
+
67
+ for file in files:
68
+ extension = _get_extension(file.filename)
69
+
70
+ if extension not in (".txt", ".csv"):
71
+ raise NotImplementedError(
72
+ "keyword detection is only supported for csv, txt files"
73
+ )
74
+
75
+ if _run_keyword_detection(file.file_IO, remote_directory.detection_keyword):
76
+ filtered_files.append(file)
77
+
78
+ return filtered_files
45
79
 
46
80
 
47
81
  def _filter_by_filename(
@@ -147,4 +147,5 @@ def main() -> None:
147
147
  handle_shutdown(logger, processes=processes)
148
148
 
149
149
 
150
- main()
150
+ if __name__ == "__main__":
151
+ main()
@@ -31,8 +31,8 @@ ENDPOINT_PATH = "api/external/recipe_links/create_recipe_link"
31
31
  class Arguments:
32
32
  recipe_from_key: identifier_t.IdentifierKey
33
33
  recipe_to_key: identifier_t.IdentifierKey
34
- link_type: typing.Literal[recipe_links_t.RecipeLinkType.CHILD] | typing.Literal[recipe_links_t.RecipeLinkType.CONTROL] | typing.Literal[recipe_links_t.RecipeLinkType.USER_LINK]
35
- name: str
34
+ link_type: typing.Literal[recipe_links_t.RecipeLinkType.CHILD] | typing.Literal[recipe_links_t.RecipeLinkType.CONTROL] | typing.Literal[recipe_links_t.RecipeLinkType.USER_LINK] | typing.Literal[recipe_links_t.RecipeLinkType.PREVIOUS_EXPERIMENT]
35
+ name: str | None = None
36
36
 
37
37
 
38
38
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -377,8 +377,8 @@ class ClientMethods(ABC):
377
377
  *,
378
378
  recipe_from_key: identifier_t.IdentifierKey,
379
379
  recipe_to_key: identifier_t.IdentifierKey,
380
- link_type: typing.Literal[recipe_links_t.RecipeLinkType.CHILD] | typing.Literal[recipe_links_t.RecipeLinkType.CONTROL] | typing.Literal[recipe_links_t.RecipeLinkType.USER_LINK],
381
- name: str,
380
+ link_type: typing.Literal[recipe_links_t.RecipeLinkType.CHILD] | typing.Literal[recipe_links_t.RecipeLinkType.CONTROL] | typing.Literal[recipe_links_t.RecipeLinkType.USER_LINK] | typing.Literal[recipe_links_t.RecipeLinkType.PREVIOUS_EXPERIMENT],
381
+ name: str | None = None,
382
382
  ) -> create_recipe_link_t.Data:
383
383
  """Create a link between two recipes. Skip if the link already exists
384
384