pythagoras 0.25.2__py3-none-any.whl → 0.25.4__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.
@@ -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
@@ -62,6 +62,6 @@ pythagoras/_900_project_stats_collector/__init__.py,sha256=Eagt-BhPPtBGgpMywx2lk
62
62
  pythagoras/_900_project_stats_collector/project_analyzer.py,sha256=uhycFKjUIXEpYcZYnak3yn4JFhchl-oZ7wt6spFxhoY,3574
63
63
  pythagoras/__init__.py,sha256=oA6bi5Ov3Io9Adn8zEmSIMqb2NAJM2MUN5fV1y7bgHA,1312
64
64
  pythagoras/core/__init__.py,sha256=yfamQZNt_7FL7vfxSoCTZq2ZL6rupp6qzcp9CHhTj3E,2674
65
- pythagoras-0.25.2.dist-info/WHEEL,sha256=X16MKk8bp2DRsAuyteHJ-9qOjzmnY0x1aj0P1ftqqWA,78
66
- pythagoras-0.25.2.dist-info/METADATA,sha256=kDDmPXDn2OWIj949sHZ9hb7uyAooJ4PWX1PtLA856JM,7449
67
- pythagoras-0.25.2.dist-info/RECORD,,
65
+ pythagoras-0.25.4.dist-info/WHEEL,sha256=X16MKk8bp2DRsAuyteHJ-9qOjzmnY0x1aj0P1ftqqWA,78
66
+ pythagoras-0.25.4.dist-info/METADATA,sha256=I25zNNhzraBPPIT-N_m1TzImFCdW-SeZEMSjlbh2w9g,12471
67
+ pythagoras-0.25.4.dist-info/RECORD,,