pythagoras 0.20.7__tar.gz → 0.20.8__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 (66) hide show
  1. {pythagoras-0.20.7 → pythagoras-0.20.8}/PKG-INFO +1 -1
  2. {pythagoras-0.20.7 → pythagoras-0.20.8}/pyproject.toml +1 -1
  3. pythagoras-0.20.8/src/pythagoras/.DS_Store +0 -0
  4. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_010_basic_portals/not_picklable_class.py +2 -0
  5. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_020_ordinary_code_portals/ordinary_decorator.py +2 -0
  6. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_020_ordinary_code_portals/ordinary_portal_core_classes.py +12 -2
  7. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_030_data_portals/data_portal_core_classes.py +4 -0
  8. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/logging_portal_core_classes.py +2 -0
  9. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_050_safe_code_portals/safe_portal_core_classes.py +2 -0
  10. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_060_autonomous_code_portals/autonomous_portal_core_classes.py +2 -0
  11. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/protected_portal_core_classes.py +2 -0
  12. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_080_pure_code_portals/pure_core_classes.py +4 -2
  13. {pythagoras-0.20.7 → pythagoras-0.20.8}/README.md +0 -0
  14. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_010_basic_portals/__init__.py +0 -0
  15. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_010_basic_portals/basic_portal_core_classes.py +0 -0
  16. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_010_basic_portals/exceptions.py +0 -0
  17. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_010_basic_portals/long_infoname.py +0 -0
  18. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_010_basic_portals/portal_tester.py +0 -0
  19. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_010_basic_portals/post_init_metaclass.py +0 -0
  20. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_020_ordinary_code_portals/__init__.py +0 -0
  21. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_020_ordinary_code_portals/code_normalizer.py +0 -0
  22. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_020_ordinary_code_portals/function_processing.py +0 -0
  23. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_030_data_portals/__init__.py +0 -0
  24. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_030_data_portals/ready_and_get.py +0 -0
  25. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_030_data_portals/storable_decorator.py +0 -0
  26. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/__init__.py +0 -0
  27. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/exception_processing_tracking.py +0 -0
  28. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/execution_environment_summary.py +0 -0
  29. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/kw_args.py +0 -0
  30. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/logging_decorator.py +0 -0
  31. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/notebook_checker.py +0 -0
  32. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/output_capturer.py +0 -0
  33. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_040_logging_code_portals/uncaught_exceptions.py +0 -0
  34. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_050_safe_code_portals/__init__.py +0 -0
  35. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_050_safe_code_portals/safe_decorator.py +0 -0
  36. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_060_autonomous_code_portals/__init__.py +0 -0
  37. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_060_autonomous_code_portals/autonomous_decorators.py +0 -0
  38. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_060_autonomous_code_portals/names_usage_analyzer.py +0 -0
  39. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/GPU_guards.py +0 -0
  40. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/OK_const.py +0 -0
  41. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/RAM_guards.py +0 -0
  42. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/__init__.py +0 -0
  43. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/fn_arg_names_checker.py +0 -0
  44. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/list_flattener.py +0 -0
  45. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/package_manager.py +0 -0
  46. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/protected_decorators.py +0 -0
  47. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_070_protected_code_portals/python_packages_guards.py +0 -0
  48. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_080_pure_code_portals/__init__.py +0 -0
  49. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_080_pure_code_portals/pure_decorator.py +0 -0
  50. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_090_swarming_portals/__init__.py +0 -0
  51. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_090_swarming_portals/output_suppressor.py +0 -0
  52. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_090_swarming_portals/swarming_portals.py +0 -0
  53. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_090_swarming_portals/system_utils.py +0 -0
  54. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_100_top_level_API/__init__.py +0 -0
  55. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_100_top_level_API/default_local_portal.py +0 -0
  56. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_100_top_level_API/top_level_API.py +0 -0
  57. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_800_signatures_and_converters/__init__.py +0 -0
  58. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_800_signatures_and_converters/base_16_32_convertors.py +0 -0
  59. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_800_signatures_and_converters/current_date_gmt_str.py +0 -0
  60. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_800_signatures_and_converters/hash_signatures.py +0 -0
  61. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_800_signatures_and_converters/node_signatures.py +0 -0
  62. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_800_signatures_and_converters/random_signatures.py +0 -0
  63. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_900_project_stats_collector/__init__.py +0 -0
  64. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/_900_project_stats_collector/project_analyzer.py +0 -0
  65. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/__init__.py +0 -0
  66. {pythagoras-0.20.7 → pythagoras-0.20.8}/src/pythagoras/core/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pythagoras
3
- Version: 0.20.7
3
+ Version: 0.20.8
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
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "pythagoras"
7
- version = "0.20.7"
7
+ version = "0.20.8"
8
8
  authors = [
9
9
  {name = "Volodymyr (Vlad) Pavlov", email = "vlpavlov@ieee.org"},
10
10
  ]
@@ -1,6 +1,8 @@
1
1
  class NotPicklable:
2
2
  def __getstate__(self):
3
+ """This method is called when the object is pickled."""
3
4
  raise TypeError(f"{type(self).__name__} cannot be pickled")
4
5
 
5
6
  def __setstate__(self, state):
7
+ """This method is called when the object is unpickled."""
6
8
  raise TypeError(f"{type(self).__name__} cannot be unpickled")
@@ -24,8 +24,10 @@ class ordinary:
24
24
 
25
25
 
26
26
  def __getstate__(self):
27
+ """This method is called when the object is pickled."""
27
28
  raise TypeError("Decorators cannot be pickled.")
28
29
 
29
30
 
30
31
  def __setstate__(self, state):
32
+ """This method is called when the object is unpickled."""
31
33
  raise TypeError("Decorators cannot be pickled.")
@@ -122,16 +122,23 @@ class OrdinaryFn(PortalAwareClass):
122
122
 
123
123
  @property
124
124
  def portal(self) -> OrdinaryCodePortal:
125
- return PortalAwareClass.portal.__get__(self)
125
+ """Get the portal which the function's methods will be using.
126
+
127
+ It's either the function's linked portal or
128
+ (if the linked portal is None) the currently active portal.
129
+ """
130
+ return super().portal
126
131
 
127
132
 
128
133
  @property
129
134
  def source_code(self) -> str:
135
+ """Get the source code of the function."""
130
136
  return self._source_code
131
137
 
132
138
 
133
139
  @property
134
140
  def name(self) -> str:
141
+ """Get the name of the function."""
135
142
  if not hasattr(self, "_name_cache") or self._name_cache is None:
136
143
  self._name_cache = get_function_name_from_source(self.source_code)
137
144
  return self._name_cache
@@ -139,7 +146,8 @@ class OrdinaryFn(PortalAwareClass):
139
146
 
140
147
  @property
141
148
  def hash_signature(self):
142
- if not hasattr(self, "_hash_signature_cache") or self._hash_signature_cache is None:
149
+ """Get the hash signature of the function."""
150
+ if not hasattr(self, "_hash_signature_cache"):
143
151
  self._hash_signature_cache = get_hash_signature(self)
144
152
  return self._hash_signature_cache
145
153
 
@@ -245,11 +253,13 @@ class OrdinaryFn(PortalAwareClass):
245
253
 
246
254
 
247
255
  def __getstate__(self):
256
+ """This method is called when the object is pickled."""
248
257
  state = dict(source_code=self._source_code)
249
258
  return state
250
259
 
251
260
 
252
261
  def __setstate__(self, state):
262
+ """This method is called when the object is unpickled."""
253
263
  PortalAwareClass.__setstate__(self, state)
254
264
  self._source_code = state["source_code"]
255
265
 
@@ -268,11 +268,13 @@ class StorableFn(OrdinaryFn):
268
268
 
269
269
 
270
270
  def __setstate__(self, state):
271
+ """This method is called when the object is unpickled."""
271
272
  super().__setstate__(state)
272
273
  self._ephemeral_config_params_at_init = dict()
273
274
 
274
275
 
275
276
  def __getstate__(self):
277
+ """This method is called when the object is pickled."""
276
278
  return super().__getstate__()
277
279
 
278
280
 
@@ -547,11 +549,13 @@ class ValueAddr(HashAddr):
547
549
 
548
550
 
549
551
  def __getstate__(self):
552
+ """This method is called when the object is pickled."""
550
553
  state = dict(strings=self.strings)
551
554
  return state
552
555
 
553
556
 
554
557
  def __setstate__(self, state):
558
+ """This method is called when the object is unpickled."""
555
559
  self._invalidate_cache()
556
560
  self.strings = state["strings"]
557
561
  self._containing_portals = set()
@@ -111,6 +111,7 @@ class LoggingFnCallSignature:
111
111
 
112
112
 
113
113
  def __getstate__(self):
114
+ """This method is called when the object is pickled."""
114
115
  state = dict(
115
116
  _fn_addr=self._fn_addr
116
117
  , _kwargs_addr=self._kwargs_addr)
@@ -118,6 +119,7 @@ class LoggingFnCallSignature:
118
119
 
119
120
 
120
121
  def __setstate__(self, state):
122
+ """This method is called when the object is unpickled."""
121
123
  self._invalidate_cache()
122
124
  self._fn_addr = state["_fn_addr"]
123
125
  self._kwargs_addr = state["_kwargs_addr"]
@@ -34,11 +34,13 @@ class SafeFn(LoggingFn):
34
34
 
35
35
 
36
36
  def __getstate__(self):
37
+ """This method is called when the object is pickled."""
37
38
  state = super().__getstate__()
38
39
  return state
39
40
 
40
41
 
41
42
  def __setstate__(self, state):
43
+ """This method is called when the object is unpickled."""
42
44
  super().__setstate__(state)
43
45
 
44
46
 
@@ -104,11 +104,13 @@ class AutonomousFn(SafeFn):
104
104
 
105
105
 
106
106
  def __getstate__(self):
107
+ """This method is called when the object is pickled."""
107
108
  state = super().__getstate__()
108
109
  state["_fixed_kwargs"] = self._fixed_kwargs
109
110
  return state
110
111
 
111
112
  def __setstate__(self, state):
113
+ """This method is called when the object is unpickled."""
112
114
  super().__setstate__(state)
113
115
  self._fixed_kwargs = state["_fixed_kwargs"]
114
116
 
@@ -66,6 +66,7 @@ class ProtectedFn(AutonomousFn):
66
66
 
67
67
 
68
68
  def __getstate__(self):
69
+ """This method is called when the object is pickled."""
69
70
  state = super().__getstate__()
70
71
  state["guards_addrs"] = self._guards_addrs
71
72
  state["validators_addrs"] = self._validators_addrs
@@ -73,6 +74,7 @@ class ProtectedFn(AutonomousFn):
73
74
 
74
75
 
75
76
  def __setstate__(self, state):
77
+ """This method is called when the object is unpickled."""
76
78
  self._invalidate_cache()
77
79
  super().__setstate__(state)
78
80
  self._guards_addrs = state["guards_addrs"]
@@ -323,12 +323,14 @@ class PureFnExecutionResultAddr(HashAddr):
323
323
  return self._kwargs_cache
324
324
 
325
325
 
326
- def __setstate__(self, state): #*#*#
326
+ def __setstate__(self, state):
327
+ """This method is called when the object is unpickled."""
327
328
  self._invalidate_cache()
328
329
  self.strings = state["strings"]
329
330
 
330
331
 
331
- def __getstate__(self): #*#*#
332
+ def __getstate__(self):
333
+ """This method is called when the object is pickled."""
332
334
  state = dict(strings=self.strings)
333
335
  return state
334
336
 
File without changes