pythagoras 0.25.3__tar.gz → 0.25.5__tar.gz

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.
Files changed (77) hide show
  1. {pythagoras-0.25.3 → pythagoras-0.25.5}/PKG-INFO +25 -18
  2. {pythagoras-0.25.3 → pythagoras-0.25.5}/README.md +24 -17
  3. {pythagoras-0.25.3 → pythagoras-0.25.5}/pyproject.toml +1 -1
  4. pythagoras-0.25.5/src/pythagoras/.DS_Store +0 -0
  5. pythagoras-0.25.5/src/pythagoras/_010_basic_portals/.DS_Store +0 -0
  6. pythagoras-0.25.5/src/pythagoras/_020_ordinary_code_portals/.DS_Store +0 -0
  7. pythagoras-0.25.5/src/pythagoras/_030_data_portals/.DS_Store +0 -0
  8. {pythagoras-0.25.3/src/pythagoras/_010_basic_portals → pythagoras-0.25.5/src/pythagoras/_040_logging_code_portals}/.DS_Store +0 -0
  9. {pythagoras-0.25.3/src/pythagoras/_020_ordinary_code_portals → pythagoras-0.25.5/src/pythagoras/_050_safe_code_portals}/.DS_Store +0 -0
  10. pythagoras-0.25.5/src/pythagoras/_060_autonomous_code_portals/.DS_Store +0 -0
  11. pythagoras-0.25.5/src/pythagoras/_070_protected_code_portals/.DS_Store +0 -0
  12. {pythagoras-0.25.3/src/pythagoras/_030_data_portals → pythagoras-0.25.5/src/pythagoras/_080_pure_code_portals}/.DS_Store +0 -0
  13. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_080_pure_code_portals/recursion_pre_validator.py +9 -5
  14. pythagoras-0.25.5/src/pythagoras/_090_swarming_portals/.DS_Store +0 -0
  15. pythagoras-0.25.5/src/pythagoras/_100_top_level_API/.DS_Store +0 -0
  16. pythagoras-0.25.5/src/pythagoras/_800_signatures_and_converters/.DS_Store +0 -0
  17. pythagoras-0.25.5/src/pythagoras/_900_project_stats_collector/.DS_Store +0 -0
  18. pythagoras-0.25.3/src/pythagoras/.DS_Store +0 -0
  19. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_010_basic_portals/__init__.py +0 -0
  20. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_010_basic_portals/basic_portal_core_classes.py +0 -0
  21. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_010_basic_portals/long_infoname.py +0 -0
  22. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_010_basic_portals/portal_tester.py +0 -0
  23. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_010_basic_portals/post_init_metaclass.py +0 -0
  24. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_020_ordinary_code_portals/__init__.py +0 -0
  25. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_020_ordinary_code_portals/code_normalizer.py +0 -0
  26. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_020_ordinary_code_portals/exceptions.py +0 -0
  27. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_020_ordinary_code_portals/function_processing.py +0 -0
  28. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_020_ordinary_code_portals/ordinary_decorator.py +0 -0
  29. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_020_ordinary_code_portals/ordinary_portal_core_classes.py +0 -0
  30. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_030_data_portals/__init__.py +0 -0
  31. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_030_data_portals/data_portal_core_classes.py +0 -0
  32. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_030_data_portals/ready_and_get.py +0 -0
  33. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_030_data_portals/storable_decorator.py +0 -0
  34. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/__init__.py +0 -0
  35. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/exception_processing_tracking.py +0 -0
  36. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/execution_environment_summary.py +0 -0
  37. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/kw_args.py +0 -0
  38. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/logging_decorator.py +0 -0
  39. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/logging_portal_core_classes.py +0 -0
  40. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/notebook_checker.py +0 -0
  41. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/output_capturer.py +0 -0
  42. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_040_logging_code_portals/uncaught_exceptions.py +0 -0
  43. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_050_safe_code_portals/__init__.py +0 -0
  44. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_050_safe_code_portals/safe_decorator.py +0 -0
  45. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_050_safe_code_portals/safe_portal_core_classes.py +0 -0
  46. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_060_autonomous_code_portals/__init__.py +0 -0
  47. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_060_autonomous_code_portals/autonomous_decorators.py +0 -0
  48. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_060_autonomous_code_portals/autonomous_portal_core_classes.py +0 -0
  49. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_060_autonomous_code_portals/names_usage_analyzer.py +0 -0
  50. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/__init__.py +0 -0
  51. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/basic_pre_validators.py +0 -0
  52. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/fn_arg_names_checker.py +0 -0
  53. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/list_flattener.py +0 -0
  54. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/package_manager.py +0 -0
  55. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/protected_decorators.py +0 -0
  56. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/protected_portal_core_classes.py +0 -0
  57. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/system_utils.py +0 -0
  58. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_070_protected_code_portals/validation_succesful_const.py +0 -0
  59. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_080_pure_code_portals/__init__.py +0 -0
  60. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_080_pure_code_portals/pure_core_classes.py +0 -0
  61. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_080_pure_code_portals/pure_decorator.py +0 -0
  62. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_090_swarming_portals/__init__.py +0 -0
  63. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_090_swarming_portals/output_suppressor.py +0 -0
  64. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_090_swarming_portals/swarming_portals.py +0 -0
  65. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_100_top_level_API/__init__.py +0 -0
  66. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_100_top_level_API/default_local_portal.py +0 -0
  67. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_100_top_level_API/top_level_API.py +0 -0
  68. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_800_signatures_and_converters/__init__.py +0 -0
  69. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_800_signatures_and_converters/base_16_32_convertors.py +0 -0
  70. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_800_signatures_and_converters/current_date_gmt_str.py +0 -0
  71. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_800_signatures_and_converters/hash_signatures.py +0 -0
  72. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_800_signatures_and_converters/node_signature.py +0 -0
  73. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_800_signatures_and_converters/random_signatures.py +0 -0
  74. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_900_project_stats_collector/__init__.py +0 -0
  75. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/_900_project_stats_collector/project_analyzer.py +0 -0
  76. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/__init__.py +0 -0
  77. {pythagoras-0.25.3 → pythagoras-0.25.5}/src/pythagoras/core/__init__.py +0 -0
@@ -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,5 +1,11 @@
1
1
  # Pythagoras
2
2
 
3
+ [![PyPI version](https://img.shields.io/pypi/v/Pythagoras.svg)](https://pypi.org/project/Pythagoras/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/Pythagoras.svg)](https://pypi.org/project/Pythagoras/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+ [![Downloads](https://static.pepy.tech/badge/Pythagoras)](https://pepy.tech/project/Pythagoras)
7
+
8
+
3
9
  Planet-scale distributed computing in Python.
4
10
 
5
11
  **!!! RESEARCH PREVIEW !!!**
@@ -146,6 +152,17 @@ assert is_odd(n=11)
146
152
 
147
153
  ## Core Concepts
148
154
 
155
+ * **Portal**: An application's "window" into the non-ephemeral world outside the current application
156
+ execution session. It's a connector that enables a link between a runtime-only ephemeral state and
157
+ a persistent state that can be saved and loaded across multiple runs of the application and across
158
+ multiple computers. Portals provide a unified interface for data persistence, caching, and state
159
+ management across distributed systems. They abstract away the complexities of storage backends
160
+ (local filesystem, cloud storage, etc.) and handle serialization/deserialization transparently.
161
+ This allows applications to seamlessly work with persistent data while maintaining isolation between
162
+ runtime and storage concerns. A program can use multiple portals, each with its own storage backend, and
163
+ each portal can be used by multiple applications. A portal defines a context for the execution of
164
+ pure functions, which is used to cache and retrieve results.
165
+
149
166
  * **Autonomous Function**: A self-contained function that does not depend on external
150
167
  imports or definitions. All necessary imports must be done inside the function body.
151
168
  These functions cannot use global objects (except built-ins), yield statements, or nonlocal variables.
@@ -165,28 +182,18 @@ assert is_odd(n=11)
165
182
  works seamlessly across different machines in a distributed system, enabling significant performance
166
183
  improvements for computationally intensive workflows.
167
184
 
168
- * **Validator**: A function that checks if certain conditions are met before or after the execution
169
- of a pure function. Pre-validators run before the function, and post-validators run after.
185
+ * **Validator**: An autonomous function that checks if certain conditions are met before or after
186
+ the execution of a pure function. Pre-validators run before the function, and post-validators run after.
170
187
  They can be passive (e.g., check for available RAM) or active (e.g., install a missing library).
171
- For example, `unused_ram(Gb=5)` ensures 5GB of free memory before execution, while `installed_packages("numpy")`
172
- verifies or installs required dependencies. Validators help ensure reliable execution across distributed
173
- systems by validating requirements and system state. Multiple validators can be combined using the
174
- standard decorator syntax to create comprehensive validation chains.
175
-
176
- * **Portal**: An application's "window" into the non-ephemeral world outside the current application
177
- execution session. It's a connector that enables a link between a runtime-only ephemeral state and
178
- a persistent state that can be saved and loaded across multiple runs of the application and across
179
- multiple computers. Portals provide a unified interface for data persistence, caching, and state
180
- management across distributed systems. They abstract away the complexities of storage backends
181
- (local filesystem, cloud storage, etc.) and handle serialization/deserialization transparently.
182
- This allows applications to seamlessly work with persistent data while maintaining isolation between
183
- runtime and storage concerns.
188
+ Validators help ensure reliable execution across distributed systems by validating requirements
189
+ and system state. Multiple validators can be combined using the standard decorator syntax
190
+ to create comprehensive validation chains.
184
191
 
185
- * **Value Address**: A globally unique address of an **immutable value**, derived from its content
192
+ * **Value Address**: A globally unique address of an ***immutable value***, derived from its content
186
193
  (type and value). It consists of a human-readable descriptor (often based on the object's type
187
194
  and shape/length) and a hash signature (SHA-256, encoded) split into parts for filesystem/storage
188
195
  efficiency. Creating a ValueAddr(data) computes the content hash of data and stores the value
189
- in the active DataPortal's storage (if not already stored), allowing that value to be retrieved later
196
+ in the active portal's storage (if not already stored), allowing that value to be retrieved later
190
197
  via the address. These addresses are used extensively by the portal to identify stored results
191
198
  and to reference inputs/outputs across distributed systems.
192
199
 
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "pythagoras"
7
- version = "0.25.3"
7
+ version = "0.25.5"
8
8
  authors = [
9
9
  {name = "Volodymyr (Vlad) Pavlov", email = "vlpavlov@ieee.org"},
10
10
  ]
@@ -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