pythagoras 0.25.2__tar.gz → 0.25.4__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 (67) hide show
  1. {pythagoras-0.25.2 → pythagoras-0.25.4}/PKG-INFO +64 -1
  2. {pythagoras-0.25.2 → pythagoras-0.25.4}/README.md +63 -0
  3. {pythagoras-0.25.2 → pythagoras-0.25.4}/pyproject.toml +1 -1
  4. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/.DS_Store +0 -0
  5. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_010_basic_portals/.DS_Store +0 -0
  6. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_010_basic_portals/__init__.py +0 -0
  7. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_010_basic_portals/basic_portal_core_classes.py +0 -0
  8. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_010_basic_portals/long_infoname.py +0 -0
  9. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_010_basic_portals/portal_tester.py +0 -0
  10. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_010_basic_portals/post_init_metaclass.py +0 -0
  11. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_020_ordinary_code_portals/.DS_Store +0 -0
  12. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_020_ordinary_code_portals/__init__.py +0 -0
  13. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_020_ordinary_code_portals/code_normalizer.py +0 -0
  14. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_020_ordinary_code_portals/exceptions.py +0 -0
  15. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_020_ordinary_code_portals/function_processing.py +0 -0
  16. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_020_ordinary_code_portals/ordinary_decorator.py +0 -0
  17. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_020_ordinary_code_portals/ordinary_portal_core_classes.py +0 -0
  18. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_030_data_portals/.DS_Store +0 -0
  19. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_030_data_portals/__init__.py +0 -0
  20. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_030_data_portals/data_portal_core_classes.py +0 -0
  21. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_030_data_portals/ready_and_get.py +0 -0
  22. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_030_data_portals/storable_decorator.py +0 -0
  23. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/__init__.py +0 -0
  24. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/exception_processing_tracking.py +0 -0
  25. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/execution_environment_summary.py +0 -0
  26. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/kw_args.py +0 -0
  27. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/logging_decorator.py +0 -0
  28. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/logging_portal_core_classes.py +0 -0
  29. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/notebook_checker.py +0 -0
  30. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/output_capturer.py +0 -0
  31. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_040_logging_code_portals/uncaught_exceptions.py +0 -0
  32. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_050_safe_code_portals/__init__.py +0 -0
  33. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_050_safe_code_portals/safe_decorator.py +0 -0
  34. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_050_safe_code_portals/safe_portal_core_classes.py +0 -0
  35. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_060_autonomous_code_portals/__init__.py +0 -0
  36. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_060_autonomous_code_portals/autonomous_decorators.py +0 -0
  37. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_060_autonomous_code_portals/autonomous_portal_core_classes.py +0 -0
  38. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_060_autonomous_code_portals/names_usage_analyzer.py +0 -0
  39. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/__init__.py +0 -0
  40. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/basic_pre_validators.py +0 -0
  41. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/fn_arg_names_checker.py +0 -0
  42. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/list_flattener.py +0 -0
  43. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/package_manager.py +0 -0
  44. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/protected_decorators.py +0 -0
  45. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/protected_portal_core_classes.py +0 -0
  46. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/system_utils.py +0 -0
  47. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_070_protected_code_portals/validation_succesful_const.py +0 -0
  48. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_080_pure_code_portals/__init__.py +0 -0
  49. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_080_pure_code_portals/pure_core_classes.py +0 -0
  50. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_080_pure_code_portals/pure_decorator.py +0 -0
  51. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_080_pure_code_portals/recursion_pre_validator.py +0 -0
  52. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_090_swarming_portals/__init__.py +0 -0
  53. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_090_swarming_portals/output_suppressor.py +0 -0
  54. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_090_swarming_portals/swarming_portals.py +0 -0
  55. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_100_top_level_API/__init__.py +0 -0
  56. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_100_top_level_API/default_local_portal.py +0 -0
  57. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_100_top_level_API/top_level_API.py +0 -0
  58. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_800_signatures_and_converters/__init__.py +0 -0
  59. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_800_signatures_and_converters/base_16_32_convertors.py +0 -0
  60. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_800_signatures_and_converters/current_date_gmt_str.py +0 -0
  61. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_800_signatures_and_converters/hash_signatures.py +0 -0
  62. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_800_signatures_and_converters/node_signature.py +0 -0
  63. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_800_signatures_and_converters/random_signatures.py +0 -0
  64. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_900_project_stats_collector/__init__.py +0 -0
  65. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/_900_project_stats_collector/project_analyzer.py +0 -0
  66. {pythagoras-0.25.2 → pythagoras-0.25.4}/src/pythagoras/__init__.py +0 -0
  67. {pythagoras-0.25.2 → pythagoras-0.25.4}/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.2
3
+ Version: 0.25.4
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
@@ -196,6 +196,69 @@ assert is_even(n=10)
196
196
  assert is_odd(n=11)
197
197
  ```
198
198
 
199
+ ## Core Concepts
200
+
201
+ * **Portal**: An application's "window" into the non-ephemeral world outside the current application
202
+ execution session. It's a connector that enables a link between a runtime-only ephemeral state and
203
+ a persistent state that can be saved and loaded across multiple runs of the application and across
204
+ multiple computers. Portals provide a unified interface for data persistence, caching, and state
205
+ management across distributed systems. They abstract away the complexities of storage backends
206
+ (local filesystem, cloud storage, etc.) and handle serialization/deserialization transparently.
207
+ This allows applications to seamlessly work with persistent data while maintaining isolation between
208
+ runtime and storage concerns. A program can use multiple portals, each with its own storage backend, and
209
+ each portal can be used by multiple applications. A portal defines a context for the execution of
210
+ pure functions, which is used to cache and retrieve results.
211
+
212
+ * **Autonomous Function**: A self-contained function that does not depend on external
213
+ imports or definitions. All necessary imports must be done inside the function body.
214
+ These functions cannot use global objects (except built-ins), yield statements, or nonlocal variables.
215
+ They must be called with keyword arguments only to ensure clear parameter passing.
216
+ This design ensures complete isolation and portability, allowing the function to execute
217
+ independently on any machine in a distributed system. The autonomous nature makes these
218
+ functions ideal building blocks for parallel and distributed computing workflows, as they
219
+ carry all their dependencies with them and maintain clear interfaces through strict
220
+ parameter passing requirements.
221
+
222
+ * **Pure Function**: A special type of autonomous function that has no side effects and always
223
+ returns the same result for the same arguments. This means the function's output depends solely
224
+ on its input parameters, without relying on any external state or modifying anything outside its scope.
225
+ Pythagoras caches the results of pure functions using content-based addressing, so if the function
226
+ is called multiple times with the same arguments, the function is executed only once, and the cached
227
+ result is returned for all subsequent executions. This caching mechanism (also known as memoization)
228
+ works seamlessly across different machines in a distributed system, enabling significant performance
229
+ improvements for computationally intensive workflows.
230
+
231
+ * **Validator**: A function that checks if certain conditions are met before or after the execution
232
+ of a pure function. Pre-validators run before the function, and post-validators run after.
233
+ They can be passive (e.g., check for available RAM) or active (e.g., install a missing library).
234
+ Validators help ensure reliable execution across distributed systems by validating requirements
235
+ and system state. Multiple validators can be combined using the standard decorator syntax
236
+ to create comprehensive validation chains.
237
+
238
+ * **Value Address**: A globally unique address of an ***immutable value***, derived from its content
239
+ (type and value). It consists of a human-readable descriptor (often based on the object's type
240
+ and shape/length) and a hash signature (SHA-256, encoded) split into parts for filesystem/storage
241
+ efficiency. Creating a ValueAddr(data) computes the content hash of data and stores the value
242
+ in the active portal's storage (if not already stored), allowing that value to be retrieved later
243
+ via the address. These addresses are used extensively by the portal to identify stored results
244
+ and to reference inputs/outputs across distributed systems.
245
+
246
+ * **Execution Result Address**: A special type of Value Address that represents the result of a pure
247
+ function execution. It combines the function's signature with its input parameters to create a unique
248
+ identifier. When a function is executed in swarm mode, it immediately returns an Execution Result Address. This address
249
+ acts as a "future" reference that can be used to check execution status and retrieve results
250
+ once they become available. The address remains valid across application restarts and
251
+ can be shared between different machines in the distributed system.
252
+
253
+ * **Swarming**: An asynchronous execution model where you do not know when your function will
254
+ be executed, what machine will execute it, and how many times it will be executed.
255
+ Pythagoras ensures that the function will be eventually executed at least once but does not
256
+ offer any further guarantees. This model enables maximum flexibility in distributed execution
257
+ by decoupling the function call from its actual execution. Functions can be queued, load-balanced,
258
+ retried on failure, and executed in parallel across multiple machines automatically. The trade-off
259
+ is reduced control over execution timing and location, in exchange for improved scalability,
260
+ fault tolerance, and resource utilization across the distributed system.
261
+
199
262
  ## How to get it?
200
263
 
201
264
  The source code is hosted on GitHub at: https://github.com/pythagoras-dev/pythagoras
@@ -144,6 +144,69 @@ assert is_even(n=10)
144
144
  assert is_odd(n=11)
145
145
  ```
146
146
 
147
+ ## Core Concepts
148
+
149
+ * **Portal**: An application's "window" into the non-ephemeral world outside the current application
150
+ execution session. It's a connector that enables a link between a runtime-only ephemeral state and
151
+ a persistent state that can be saved and loaded across multiple runs of the application and across
152
+ multiple computers. Portals provide a unified interface for data persistence, caching, and state
153
+ management across distributed systems. They abstract away the complexities of storage backends
154
+ (local filesystem, cloud storage, etc.) and handle serialization/deserialization transparently.
155
+ This allows applications to seamlessly work with persistent data while maintaining isolation between
156
+ runtime and storage concerns. A program can use multiple portals, each with its own storage backend, and
157
+ each portal can be used by multiple applications. A portal defines a context for the execution of
158
+ pure functions, which is used to cache and retrieve results.
159
+
160
+ * **Autonomous Function**: A self-contained function that does not depend on external
161
+ imports or definitions. All necessary imports must be done inside the function body.
162
+ These functions cannot use global objects (except built-ins), yield statements, or nonlocal variables.
163
+ They must be called with keyword arguments only to ensure clear parameter passing.
164
+ This design ensures complete isolation and portability, allowing the function to execute
165
+ independently on any machine in a distributed system. The autonomous nature makes these
166
+ functions ideal building blocks for parallel and distributed computing workflows, as they
167
+ carry all their dependencies with them and maintain clear interfaces through strict
168
+ parameter passing requirements.
169
+
170
+ * **Pure Function**: A special type of autonomous function that has no side effects and always
171
+ returns the same result for the same arguments. This means the function's output depends solely
172
+ on its input parameters, without relying on any external state or modifying anything outside its scope.
173
+ Pythagoras caches the results of pure functions using content-based addressing, so if the function
174
+ is called multiple times with the same arguments, the function is executed only once, and the cached
175
+ result is returned for all subsequent executions. This caching mechanism (also known as memoization)
176
+ works seamlessly across different machines in a distributed system, enabling significant performance
177
+ improvements for computationally intensive workflows.
178
+
179
+ * **Validator**: A function that checks if certain conditions are met before or after the execution
180
+ of a pure function. Pre-validators run before the function, and post-validators run after.
181
+ They can be passive (e.g., check for available RAM) or active (e.g., install a missing library).
182
+ Validators help ensure reliable execution across distributed systems by validating requirements
183
+ and system state. Multiple validators can be combined using the standard decorator syntax
184
+ to create comprehensive validation chains.
185
+
186
+ * **Value Address**: A globally unique address of an ***immutable value***, derived from its content
187
+ (type and value). It consists of a human-readable descriptor (often based on the object's type
188
+ and shape/length) and a hash signature (SHA-256, encoded) split into parts for filesystem/storage
189
+ efficiency. Creating a ValueAddr(data) computes the content hash of data and stores the value
190
+ in the active portal's storage (if not already stored), allowing that value to be retrieved later
191
+ via the address. These addresses are used extensively by the portal to identify stored results
192
+ and to reference inputs/outputs across distributed systems.
193
+
194
+ * **Execution Result Address**: A special type of Value Address that represents the result of a pure
195
+ function execution. It combines the function's signature with its input parameters to create a unique
196
+ identifier. When a function is executed in swarm mode, it immediately returns an Execution Result Address. This address
197
+ acts as a "future" reference that can be used to check execution status and retrieve results
198
+ once they become available. The address remains valid across application restarts and
199
+ can be shared between different machines in the distributed system.
200
+
201
+ * **Swarming**: An asynchronous execution model where you do not know when your function will
202
+ be executed, what machine will execute it, and how many times it will be executed.
203
+ Pythagoras ensures that the function will be eventually executed at least once but does not
204
+ offer any further guarantees. This model enables maximum flexibility in distributed execution
205
+ by decoupling the function call from its actual execution. Functions can be queued, load-balanced,
206
+ retried on failure, and executed in parallel across multiple machines automatically. The trade-off
207
+ is reduced control over execution timing and location, in exchange for improved scalability,
208
+ fault tolerance, and resource utilization across the distributed system.
209
+
147
210
  ## How to get it?
148
211
 
149
212
  The source code is hosted on GitHub at: https://github.com/pythagoras-dev/pythagoras
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "pythagoras"
7
- version = "0.25.2"
7
+ version = "0.25.4"
8
8
  authors = [
9
9
  {name = "Volodymyr (Vlad) Pavlov", email = "vlpavlov@ieee.org"},
10
10
  ]