pythagoras 0.25.2__py3-none-any.whl → 0.25.3__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.3
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,68 @@ assert is_even(n=10)
196
196
  assert is_odd(n=11)
197
197
  ```
198
198
 
199
+ ## Core Concepts
200
+
201
+ * **Autonomous Function**: A self-contained function that does not depend on external
202
+ imports or definitions. All necessary imports must be done inside the function body.
203
+ These functions cannot use global objects (except built-ins), yield statements, or nonlocal variables.
204
+ They must be called with keyword arguments only to ensure clear parameter passing.
205
+ This design ensures complete isolation and portability, allowing the function to execute
206
+ independently on any machine in a distributed system. The autonomous nature makes these
207
+ functions ideal building blocks for parallel and distributed computing workflows, as they
208
+ carry all their dependencies with them and maintain clear interfaces through strict
209
+ parameter passing requirements.
210
+
211
+ * **Pure Function**: A special type of autonomous function that has no side effects and always
212
+ returns the same result for the same arguments. This means the function's output depends solely
213
+ on its input parameters, without relying on any external state or modifying anything outside its scope.
214
+ Pythagoras caches the results of pure functions using content-based addressing, so if the function
215
+ is called multiple times with the same arguments, the function is executed only once, and the cached
216
+ result is returned for all subsequent executions. This caching mechanism (also known as memoization)
217
+ works seamlessly across different machines in a distributed system, enabling significant performance
218
+ improvements for computationally intensive workflows.
219
+
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.
222
+ 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.
236
+
237
+ * **Value Address**: A globally unique address of an **immutable value**, derived from its content
238
+ (type and value). It consists of a human-readable descriptor (often based on the object's type
239
+ and shape/length) and a hash signature (SHA-256, encoded) split into parts for filesystem/storage
240
+ 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
242
+ via the address. These addresses are used extensively by the portal to identify stored results
243
+ and to reference inputs/outputs across distributed systems.
244
+
245
+ * **Execution Result Address**: A special type of Value Address that represents the result of a pure
246
+ function execution. It combines the function's signature with its input parameters to create a unique
247
+ identifier. When a function is executed in swarm mode, it immediately returns an Execution Result Address. This address
248
+ acts as a "future" reference that can be used to check execution status and retrieve results
249
+ once they become available. The address remains valid across application restarts and
250
+ can be shared between different machines in the distributed system.
251
+
252
+ * **Swarming**: An asynchronous execution model where you do not know when your function will
253
+ be executed, what machine will execute it, and how many times it will be executed.
254
+ Pythagoras ensures that the function will be eventually executed at least once but does not
255
+ offer any further guarantees. This model enables maximum flexibility in distributed execution
256
+ by decoupling the function call from its actual execution. Functions can be queued, load-balanced,
257
+ retried on failure, and executed in parallel across multiple machines automatically. The trade-off
258
+ is reduced control over execution timing and location, in exchange for improved scalability,
259
+ fault tolerance, and resource utilization across the distributed system.
260
+
199
261
  ## How to get it?
200
262
 
201
263
  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.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,,