pythagoras 0.25.3__py3-none-any.whl → 0.25.5__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.
pythagoras/.DS_Store CHANGED
Binary file
Binary file
Binary file
@@ -50,12 +50,17 @@ def _recursion_pre_validator(
50
50
  raise TypeError(f"Parameter '{param_name}' must be int, got {type(param_value).__name__}")
51
51
  if param_value < 0:
52
52
  raise ValueError(f"Parameter '{param_name}' must be non-negative, got {param_value}")
53
- if param_value in {0,1}:
53
+ if param_value in {0,1,2,3,4}:
54
54
  return pth.VALIDATION_SUCCESSFUL
55
-
55
+ unpacked_kwargs[param_name] = param_value - 1
56
+ result_addr = pth.PureFnExecutionResultAddr(
57
+ fn=fn, arguments=unpacked_kwargs)
58
+ if result_addr.ready:
59
+ return pth.VALIDATION_SUCCESSFUL
60
+ result = result_addr.call_signature
61
+
56
62
  # Binary search to find the smallest n where result_addr.ready is not True
57
- left, right = 2, param_value - 1
58
- result = pth.VALIDATION_SUCCESSFUL # Default result if all are ready
63
+ left, right = 2, param_value - 2
59
64
 
60
65
  while left <= right:
61
66
  mid = (left + right) // 2
@@ -72,7 +77,6 @@ def _recursion_pre_validator(
72
77
  # Result is ready, search in the right half
73
78
  left = mid + 1
74
79
 
75
-
76
80
  return result
77
81
 
78
82
 
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pythagoras
3
- Version: 0.25.3
3
+ Version: 0.25.5
4
4
  Summary: Planet-scale distributed computing in Python.
5
5
  Keywords: cloud,ML,AI,serverless,distributed,parallel,machine-learning,deep-learning,pythagoras
6
6
  Author: Volodymyr (Vlad) Pavlov
@@ -52,6 +52,12 @@ Description-Content-Type: text/markdown
52
52
 
53
53
  # Pythagoras
54
54
 
55
+ [![PyPI version](https://img.shields.io/pypi/v/Pythagoras.svg)](https://pypi.org/project/Pythagoras/)
56
+ [![Python versions](https://img.shields.io/pypi/pyversions/Pythagoras.svg)](https://pypi.org/project/Pythagoras/)
57
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
58
+ [![Downloads](https://static.pepy.tech/badge/Pythagoras)](https://pepy.tech/project/Pythagoras)
59
+
60
+
55
61
  Planet-scale distributed computing in Python.
56
62
 
57
63
  **!!! RESEARCH PREVIEW !!!**
@@ -198,6 +204,17 @@ assert is_odd(n=11)
198
204
 
199
205
  ## Core Concepts
200
206
 
207
+ * **Portal**: An application's "window" into the non-ephemeral world outside the current application
208
+ execution session. It's a connector that enables a link between a runtime-only ephemeral state and
209
+ a persistent state that can be saved and loaded across multiple runs of the application and across
210
+ multiple computers. Portals provide a unified interface for data persistence, caching, and state
211
+ management across distributed systems. They abstract away the complexities of storage backends
212
+ (local filesystem, cloud storage, etc.) and handle serialization/deserialization transparently.
213
+ This allows applications to seamlessly work with persistent data while maintaining isolation between
214
+ runtime and storage concerns. A program can use multiple portals, each with its own storage backend, and
215
+ each portal can be used by multiple applications. A portal defines a context for the execution of
216
+ pure functions, which is used to cache and retrieve results.
217
+
201
218
  * **Autonomous Function**: A self-contained function that does not depend on external
202
219
  imports or definitions. All necessary imports must be done inside the function body.
203
220
  These functions cannot use global objects (except built-ins), yield statements, or nonlocal variables.
@@ -217,28 +234,18 @@ assert is_odd(n=11)
217
234
  works seamlessly across different machines in a distributed system, enabling significant performance
218
235
  improvements for computationally intensive workflows.
219
236
 
220
- * **Validator**: A function that checks if certain conditions are met before or after the execution
221
- of a pure function. Pre-validators run before the function, and post-validators run after.
237
+ * **Validator**: An autonomous function that checks if certain conditions are met before or after
238
+ the execution of a pure function. Pre-validators run before the function, and post-validators run after.
222
239
  They can be passive (e.g., check for available RAM) or active (e.g., install a missing library).
223
- For example, `unused_ram(Gb=5)` ensures 5GB of free memory before execution, while `installed_packages("numpy")`
224
- verifies or installs required dependencies. Validators help ensure reliable execution across distributed
225
- systems by validating requirements and system state. Multiple validators can be combined using the
226
- standard decorator syntax to create comprehensive validation chains.
227
-
228
- * **Portal**: An application's "window" into the non-ephemeral world outside the current application
229
- execution session. It's a connector that enables a link between a runtime-only ephemeral state and
230
- a persistent state that can be saved and loaded across multiple runs of the application and across
231
- multiple computers. Portals provide a unified interface for data persistence, caching, and state
232
- management across distributed systems. They abstract away the complexities of storage backends
233
- (local filesystem, cloud storage, etc.) and handle serialization/deserialization transparently.
234
- This allows applications to seamlessly work with persistent data while maintaining isolation between
235
- runtime and storage concerns.
240
+ Validators help ensure reliable execution across distributed systems by validating requirements
241
+ and system state. Multiple validators can be combined using the standard decorator syntax
242
+ to create comprehensive validation chains.
236
243
 
237
- * **Value Address**: A globally unique address of an **immutable value**, derived from its content
244
+ * **Value Address**: A globally unique address of an ***immutable value***, derived from its content
238
245
  (type and value). It consists of a human-readable descriptor (often based on the object's type
239
246
  and shape/length) and a hash signature (SHA-256, encoded) split into parts for filesystem/storage
240
247
  efficiency. Creating a ValueAddr(data) computes the content hash of data and stores the value
241
- in the active DataPortal's storage (if not already stored), allowing that value to be retrieved later
248
+ in the active portal's storage (if not already stored), allowing that value to be retrieved later
242
249
  via the address. These addresses are used extensively by the portal to identify stored results
243
250
  and to reference inputs/outputs across distributed systems.
244
251
 
@@ -1,22 +1,23 @@
1
- pythagoras/.DS_Store,sha256=ZYYjL1C8YSOXGFZXmWt3zmDTcIm1jxEmc0BF3f-v8X0,12292
2
- pythagoras/_010_basic_portals/.DS_Store,sha256=II7LyKebA7xJVbhYWnf3WYeZwdIwXs29y7S7XNMjeVY,6148
1
+ pythagoras/.DS_Store,sha256=5wiLlLmnKc1n5s8_gb9-zTLc63vpMGQMQtrld6M4GP4,8196
2
+ pythagoras/_010_basic_portals/.DS_Store,sha256=SyPTnduZgvgOlrP5Jp0o9nC6pUH7g-BK_aB1_dg3ozQ,6148
3
3
  pythagoras/_010_basic_portals/__init__.py,sha256=fX7p16EhJErnO2uN4HIu-F1OdfmZ24IMc0qBg9hXgrw,1642
4
4
  pythagoras/_010_basic_portals/basic_portal_core_classes.py,sha256=sWUo8kRomJcM0VxWOJwYHpkUAK1NnBJ8UyR-xIKkVTU,24917
5
5
  pythagoras/_010_basic_portals/long_infoname.py,sha256=KXOmHfQ_5hdZNqfB3Cif2CQiZ3XI3UAOEXKl3DLLYF4,1366
6
6
  pythagoras/_010_basic_portals/portal_tester.py,sha256=icm9ZsmYg3l0DAKC3l4vkCB76jthHWyR_8D9aiSVkuQ,3452
7
7
  pythagoras/_010_basic_portals/post_init_metaclass.py,sha256=94FEVMCJBUReRb-fo2-LW8YWXUXw5lLLYlXMnlxHJuU,1495
8
- pythagoras/_020_ordinary_code_portals/.DS_Store,sha256=uHrtkrAV_UVGmtRSUsqVr_7PT799H7dfwA7ARtTduDw,6148
8
+ pythagoras/_020_ordinary_code_portals/.DS_Store,sha256=16GbH9SWbcO6wuvkCY8k-8Pj5K_nF4povX7lcKOEOrY,8196
9
9
  pythagoras/_020_ordinary_code_portals/__init__.py,sha256=z0-HUn9IWmL0c1FOmFlMzk0THBYwJuDw6FXpV8YeGUM,1321
10
10
  pythagoras/_020_ordinary_code_portals/code_normalizer.py,sha256=vqZ93CXeHBAgiQe_0LZ7qRZ4eT4ZSZit04DjkDWTgGw,6973
11
11
  pythagoras/_020_ordinary_code_portals/exceptions.py,sha256=hYvvXXANTRFKnRKGrOFZjIgwDwRXaUA9pxUmOSAOyog,274
12
12
  pythagoras/_020_ordinary_code_portals/function_processing.py,sha256=ZlA9yVmZTa6Q_LxDoZidK8QJZkrqiFnX89xu45LwJ44,4931
13
13
  pythagoras/_020_ordinary_code_portals/ordinary_decorator.py,sha256=O0WGZYMKtrf2oT8j7GYsrmkQ7PYjiDfTQrJxpjdzSkA,1545
14
14
  pythagoras/_020_ordinary_code_portals/ordinary_portal_core_classes.py,sha256=6QkaBj0gigA7n0xW70KzSmo5Bt8tY_UpmQE5g1lHMLU,16050
15
- pythagoras/_030_data_portals/.DS_Store,sha256=CvBEc4Yc6D-llDES76o3jmze8TquB4ZD1jy2VZ8PRb0,6148
15
+ pythagoras/_030_data_portals/.DS_Store,sha256=9flOwntPyYLLwCTCE5bdQLps9o3GYwoKUQPHeY96XMo,6148
16
16
  pythagoras/_030_data_portals/__init__.py,sha256=f_F9DCmuVgPMgzwRjuNj6FI63S3oXu7lj3zU66Nw7Hc,1427
17
17
  pythagoras/_030_data_portals/data_portal_core_classes.py,sha256=mGOX2OLPiEXyIuBMR66IM1lVZS32Q0Q4NxbFwqPWeGc,22711
18
18
  pythagoras/_030_data_portals/ready_and_get.py,sha256=lgkDygF4lFnZXcCvP5dmvzQX64wrZ8AnYJTI7v2ppng,4172
19
19
  pythagoras/_030_data_portals/storable_decorator.py,sha256=zoJec_HBHFI5PBrF1khkPjaiviKTgdglr2F5HB42ySE,1292
20
+ pythagoras/_040_logging_code_portals/.DS_Store,sha256=RsjvHGpmn53BwBQmcJAkfxm1gTuS6uAiL2DzJJymb_I,6148
20
21
  pythagoras/_040_logging_code_portals/__init__.py,sha256=q2hVyOVgE-9Ru3ycilK98YS9Rat8tSc6erd7AtGxpaA,996
21
22
  pythagoras/_040_logging_code_portals/exception_processing_tracking.py,sha256=DH1eeJAeVL6Fn-6sXBqx3Ocu2RXxVhLqdH1mvhM24VY,1850
22
23
  pythagoras/_040_logging_code_portals/execution_environment_summary.py,sha256=-0ynNibGfRh3J1Sq-N9j7eN1FlGvetEBiW0L4K_qJ30,3813
@@ -26,13 +27,16 @@ pythagoras/_040_logging_code_portals/logging_portal_core_classes.py,sha256=nCYWp
26
27
  pythagoras/_040_logging_code_portals/notebook_checker.py,sha256=qO7zfMC20hM4tSxlqB7gy6WI4imWX4Xl7ojSwgeVu0A,871
27
28
  pythagoras/_040_logging_code_portals/output_capturer.py,sha256=ohCp6qqxL7IuJGfnFuCIgj5Oc4HmC8c7uZGE_uzWkZk,4216
28
29
  pythagoras/_040_logging_code_portals/uncaught_exceptions.py,sha256=vQrY1mOYdAeKaCmCCY1MUy4xoXurQkfwQuDA43giPl0,4564
30
+ pythagoras/_050_safe_code_portals/.DS_Store,sha256=QTfd3CjdIT5D3IfCl9k-I23xwJsRUDWszBkAIqe4Ino,6148
29
31
  pythagoras/_050_safe_code_portals/__init__.py,sha256=YR-V6W2WZ17SjqmTyY2xdY16xTVEEuLs2MddJj_WCZU,557
30
32
  pythagoras/_050_safe_code_portals/safe_decorator.py,sha256=F0d_UXuiF0S7FGYYmjkBgIuSd5iBNn6Ty7CrHV65_4I,1785
31
33
  pythagoras/_050_safe_code_portals/safe_portal_core_classes.py,sha256=1qMwR5RC4jzQVrcZ92ywHiDfCTFVzwPYZdPV1wH3a08,5850
34
+ pythagoras/_060_autonomous_code_portals/.DS_Store,sha256=vpgKPXuQXZ0Iby1X6z5LaaYeHbfUAoHcqCIduOaRQ_I,8196
32
35
  pythagoras/_060_autonomous_code_portals/__init__.py,sha256=hnv_dxxRx8c7IDf1QgVYHfYoeVAz8oD9K0oWI_o9N20,1704
33
36
  pythagoras/_060_autonomous_code_portals/autonomous_decorators.py,sha256=wJ4Dm0Vnvfv_TlwJKTBrLfistAH2V85zk9xxOF0NWk0,4367
34
37
  pythagoras/_060_autonomous_code_portals/autonomous_portal_core_classes.py,sha256=1T5zcujRz3scWlzV6OGwK7GZJpNf-mvFILjOuw6Q4rk,10377
35
38
  pythagoras/_060_autonomous_code_portals/names_usage_analyzer.py,sha256=CZzYo3vII3JdpPoAP9Rny3lYiK48zuw981A76NWGblQ,12020
39
+ pythagoras/_070_protected_code_portals/.DS_Store,sha256=1lFlJ5EFymdzGAUAaI30vcaaLHt3F1LwpG7xILf9jsM,6148
36
40
  pythagoras/_070_protected_code_portals/__init__.py,sha256=TvGcJaz20Qqsmv8m2pA4duBtFn_CdCKfkSbOSFoJS8k,989
37
41
  pythagoras/_070_protected_code_portals/basic_pre_validators.py,sha256=N5E1Gz_ULafZ8RQ1MvCQ6y29rfRVTQw7NZTqZ-pMOPo,6570
38
42
  pythagoras/_070_protected_code_portals/fn_arg_names_checker.py,sha256=HZJVhdyX2xNw0e7S9Wyz0jDun-5xBuhM71Tw2zHbYXc,1603
@@ -42,26 +46,31 @@ pythagoras/_070_protected_code_portals/protected_decorators.py,sha256=U3rz4qab9X
42
46
  pythagoras/_070_protected_code_portals/protected_portal_core_classes.py,sha256=oygVKoXPVci8OhpiBAvgT1Uemj3COQSTx8-BUhdHQbg,24042
43
47
  pythagoras/_070_protected_code_portals/system_utils.py,sha256=Uv111FaO33xAA9wZ2iwtW8Gf-FXJBP2ld1sMBmvsHdo,5124
44
48
  pythagoras/_070_protected_code_portals/validation_succesful_const.py,sha256=DrM-Mf6dDLFJ7AmfzntD39Z23YMFfF6am78XU54AlnM,577
49
+ pythagoras/_080_pure_code_portals/.DS_Store,sha256=7Hw2ywKd2_cT6DdEeFusb8FikZadNTywabAGqDpOvaw,6148
45
50
  pythagoras/_080_pure_code_portals/__init__.py,sha256=m9fC8hK4ve5VOJJKywAbUcyZJ9v5KiovI0O-HsXZHCg,1302
46
51
  pythagoras/_080_pure_code_portals/pure_core_classes.py,sha256=6UjCU28hDWD1CFeyzl9wFAWtRHc1Hea7yiCxV6-JLaI,27070
47
52
  pythagoras/_080_pure_code_portals/pure_decorator.py,sha256=rmvtw_RpTbLjPTfy_2rdjfNSvV735hzTV_9q3drQKew,4036
48
- pythagoras/_080_pure_code_portals/recursion_pre_validator.py,sha256=Wb8ZcAO1xlfOUci8EEklToF54Uqmwya6EKmk7DVYcOg,3833
53
+ pythagoras/_080_pure_code_portals/recursion_pre_validator.py,sha256=pYP7yybkPs-fzuZT9mYyvie_q8H_x0nwdsmU7SRnYyI,4004
54
+ pythagoras/_090_swarming_portals/.DS_Store,sha256=ej2yPeAYBAemK4O3B-CM7evu22Yes4SvpAs3z9L4Wd0,6148
49
55
  pythagoras/_090_swarming_portals/__init__.py,sha256=TuA17PftTBudptAblNtBlD46BqUiitksOtf3y01QKm0,514
50
56
  pythagoras/_090_swarming_portals/output_suppressor.py,sha256=IspRrfLt6pI9iuD8I1dfpnQLpRi5sO11pP5QvIGVoMo,1581
51
57
  pythagoras/_090_swarming_portals/swarming_portals.py,sha256=Dx9aUnfqlb_rSd2YORiImmuTgbPEMITGRJ6JPQts45E,20197
58
+ pythagoras/_100_top_level_API/.DS_Store,sha256=1lFlJ5EFymdzGAUAaI30vcaaLHt3F1LwpG7xILf9jsM,6148
52
59
  pythagoras/_100_top_level_API/__init__.py,sha256=Jt6VWVCBygqnwl7_-s-jhdYp6masO_SuM2xQP4a96tk,505
53
60
  pythagoras/_100_top_level_API/default_local_portal.py,sha256=SnykTpTXg1KuT1qwDnrAZ63lYshMy-0nNiUgoOVMxCs,339
54
61
  pythagoras/_100_top_level_API/top_level_API.py,sha256=S2NXW4bfL98o6Txn6NM0EeBb1nzwFtPSl-yWNevAQIE,906
62
+ pythagoras/_800_signatures_and_converters/.DS_Store,sha256=1lFlJ5EFymdzGAUAaI30vcaaLHt3F1LwpG7xILf9jsM,6148
55
63
  pythagoras/_800_signatures_and_converters/__init__.py,sha256=bva3Tyy00hC3NVEGnxU_uITXkoMHUfdHUd7pndLks0M,915
56
64
  pythagoras/_800_signatures_and_converters/base_16_32_convertors.py,sha256=-E67xY0zUUMyn-xeRpwz7-sZfFXaaiVFLKQf2OHgNw0,2146
57
65
  pythagoras/_800_signatures_and_converters/current_date_gmt_str.py,sha256=jMBQaUj_33Yto415IxuiRrNoiuxbORZS-En7bPP1JZU,841
58
66
  pythagoras/_800_signatures_and_converters/hash_signatures.py,sha256=-RDExpYwXCWXtjgIfS3xiCYAJxGuiFSZzJ4p2pAvdmc,2278
59
67
  pythagoras/_800_signatures_and_converters/node_signature.py,sha256=W5Rg6q0jBRRJzHnnemt8mVapoy2jIswOEg9xIm4poXo,1090
60
68
  pythagoras/_800_signatures_and_converters/random_signatures.py,sha256=IpZ7uwReCd-K9Yq1IZoubxn7kidnRfpB9-GBKXdqYdA,719
69
+ pythagoras/_900_project_stats_collector/.DS_Store,sha256=1lFlJ5EFymdzGAUAaI30vcaaLHt3F1LwpG7xILf9jsM,6148
61
70
  pythagoras/_900_project_stats_collector/__init__.py,sha256=Eagt-BhPPtBGgpMywx2lkLDK1603Y9t_QBdtHKUHHFY,71
62
71
  pythagoras/_900_project_stats_collector/project_analyzer.py,sha256=uhycFKjUIXEpYcZYnak3yn4JFhchl-oZ7wt6spFxhoY,3574
63
72
  pythagoras/__init__.py,sha256=oA6bi5Ov3Io9Adn8zEmSIMqb2NAJM2MUN5fV1y7bgHA,1312
64
73
  pythagoras/core/__init__.py,sha256=yfamQZNt_7FL7vfxSoCTZq2ZL6rupp6qzcp9CHhTj3E,2674
65
- pythagoras-0.25.3.dist-info/WHEEL,sha256=X16MKk8bp2DRsAuyteHJ-9qOjzmnY0x1aj0P1ftqqWA,78
66
- pythagoras-0.25.3.dist-info/METADATA,sha256=0gDVXOPe0N5MUec2GLaP2avLwe5sFkU2qFYXIlzJ0u8,12390
67
- pythagoras-0.25.3.dist-info/RECORD,,
74
+ pythagoras-0.25.5.dist-info/WHEEL,sha256=k57ZwB-NkeM_6AsPnuOHv5gI5KM5kPD6Vx85WmGEcI0,78
75
+ pythagoras-0.25.5.dist-info/METADATA,sha256=8XMhXxcGY5eor8ie6POJgVMwlJBjgXZKA4npYJEyxo8,12878
76
+ pythagoras-0.25.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.2
2
+ Generator: uv 0.9.4
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any