pythagoras 0.23.7__tar.gz → 0.23.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 (65) hide show
  1. {pythagoras-0.23.7 → pythagoras-0.23.8}/PKG-INFO +1 -1
  2. {pythagoras-0.23.7 → pythagoras-0.23.8}/pyproject.toml +1 -1
  3. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_030_data_portals/data_portal_core_classes.py +1 -1
  4. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/logging_portal_core_classes.py +1 -1
  5. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_050_safe_code_portals/safe_portal_core_classes.py +1 -1
  6. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_060_autonomous_code_portals/autonomous_portal_core_classes.py +16 -11
  7. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/protected_portal_core_classes.py +31 -21
  8. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_080_pure_code_portals/pure_core_classes.py +1 -1
  9. {pythagoras-0.23.7 → pythagoras-0.23.8}/README.md +0 -0
  10. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/.DS_Store +0 -0
  11. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_010_basic_portals/__init__.py +0 -0
  12. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_010_basic_portals/basic_portal_core_classes.py +0 -0
  13. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_010_basic_portals/exceptions.py +0 -0
  14. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_010_basic_portals/long_infoname.py +0 -0
  15. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_010_basic_portals/not_picklable_class.py +0 -0
  16. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_010_basic_portals/portal_tester.py +0 -0
  17. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_010_basic_portals/post_init_metaclass.py +0 -0
  18. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_020_ordinary_code_portals/__init__.py +0 -0
  19. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_020_ordinary_code_portals/code_normalizer.py +0 -0
  20. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_020_ordinary_code_portals/function_processing.py +0 -0
  21. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_020_ordinary_code_portals/ordinary_decorator.py +0 -0
  22. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_020_ordinary_code_portals/ordinary_portal_core_classes.py +0 -0
  23. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_030_data_portals/__init__.py +0 -0
  24. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_030_data_portals/ready_and_get.py +0 -0
  25. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_030_data_portals/storable_decorator.py +0 -0
  26. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/__init__.py +0 -0
  27. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/exception_processing_tracking.py +0 -0
  28. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/execution_environment_summary.py +0 -0
  29. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/kw_args.py +0 -0
  30. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/logging_decorator.py +0 -0
  31. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/notebook_checker.py +0 -0
  32. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/output_capturer.py +0 -0
  33. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_040_logging_code_portals/uncaught_exceptions.py +0 -0
  34. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_050_safe_code_portals/__init__.py +0 -0
  35. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_050_safe_code_portals/safe_decorator.py +0 -0
  36. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_060_autonomous_code_portals/__init__.py +0 -0
  37. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_060_autonomous_code_portals/autonomous_decorators.py +0 -0
  38. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_060_autonomous_code_portals/names_usage_analyzer.py +0 -0
  39. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/__init__.py +0 -0
  40. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/basic_pre_validators.py +0 -0
  41. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/fn_arg_names_checker.py +0 -0
  42. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/list_flattener.py +0 -0
  43. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/package_manager.py +0 -0
  44. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/protected_decorators.py +0 -0
  45. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/system_utils.py +0 -0
  46. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/validation_succesful_const.py +0 -0
  47. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_070_protected_code_portals/validator_fn_classes.py +0 -0
  48. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_080_pure_code_portals/__init__.py +0 -0
  49. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_080_pure_code_portals/pure_decorator.py +0 -0
  50. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_090_swarming_portals/__init__.py +0 -0
  51. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_090_swarming_portals/output_suppressor.py +0 -0
  52. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_090_swarming_portals/swarming_portals.py +0 -0
  53. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_100_top_level_API/__init__.py +0 -0
  54. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_100_top_level_API/default_local_portal.py +0 -0
  55. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_100_top_level_API/top_level_API.py +0 -0
  56. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_800_signatures_and_converters/__init__.py +0 -0
  57. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_800_signatures_and_converters/base_16_32_convertors.py +0 -0
  58. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_800_signatures_and_converters/current_date_gmt_str.py +0 -0
  59. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_800_signatures_and_converters/hash_signatures.py +0 -0
  60. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_800_signatures_and_converters/node_signature.py +0 -0
  61. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_800_signatures_and_converters/random_signatures.py +0 -0
  62. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_900_project_stats_collector/__init__.py +0 -0
  63. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/_900_project_stats_collector/project_analyzer.py +0 -0
  64. {pythagoras-0.23.7 → pythagoras-0.23.8}/src/pythagoras/__init__.py +0 -0
  65. {pythagoras-0.23.7 → pythagoras-0.23.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.23.7
3
+ Version: 0.23.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.23.7"
7
+ version = "0.23.8"
8
8
  authors = [
9
9
  {name = "Volodymyr (Vlad) Pavlov", email = "vlpavlov@ieee.org"},
10
10
  ]
@@ -219,7 +219,7 @@ class StorableFn(OrdinaryFn):
219
219
 
220
220
  @property
221
221
  def portal(self) -> DataPortal:
222
- return OrdinaryFn.portal.__get__(self)
222
+ return super().portal
223
223
 
224
224
 
225
225
  def _get_config_setting(self, key: SafeStrTuple, portal:DataPortal) -> Any:
@@ -72,7 +72,7 @@ class LoggingFn(StorableFn):
72
72
 
73
73
  @property
74
74
  def portal(self) -> LoggingCodePortal:
75
- return StorableFn.portal.__get__(self)
75
+ return super().portal
76
76
 
77
77
 
78
78
  class LoggingFnCallSignature:
@@ -59,7 +59,7 @@ class SafeFn(LoggingFn):
59
59
 
60
60
  @property
61
61
  def portal(self) -> SafeCodePortal:
62
- return LoggingFn.portal.__get__(self)
62
+ return super().portal
63
63
 
64
64
 
65
65
  register_parameterizable_class(SafeCodePortal)
@@ -4,6 +4,8 @@ import builtins
4
4
  from typing import Callable, Any
5
5
 
6
6
  from persidict import PersiDict, Joker, KEEP_CURRENT
7
+
8
+ from .._010_basic_portals import PortalAwareClass
7
9
  from .._020_ordinary_code_portals.code_normalizer import _pythagoras_decorator_names
8
10
  from .._030_data_portals import DataPortal
9
11
  from .._040_logging_code_portals import KwArgs
@@ -29,7 +31,7 @@ class AutonomousCodePortal(SafeCodePortal):
29
31
 
30
32
  class AutonomousFn(SafeFn):
31
33
 
32
- _fixed_kwargs_cached: KwArgs | None
34
+ _fixed_kwargs_cache: KwArgs | None
33
35
  _fixed_kwargs_packed: KwArgs | None
34
36
 
35
37
  def __init__(self, fn: Callable|str|SafeFn
@@ -46,9 +48,9 @@ class AutonomousFn(SafeFn):
46
48
 
47
49
  if isinstance(fn, AutonomousFn):
48
50
  self._fixed_kwargs_packed.update(fixed_kwargs_packed)
49
- self._fixed_kwargs_cached = KwArgs(**{**fn.fixed_kwargs, **fixed_kwargs})
51
+ self._fixed_kwargs_cache = KwArgs(**{**fn.fixed_kwargs, **fixed_kwargs})
50
52
  else:
51
- self._fixed_kwargs_cached = fixed_kwargs
53
+ self._fixed_kwargs_cache = fixed_kwargs
52
54
  self._fixed_kwargs_packed = fixed_kwargs_packed
53
55
 
54
56
  fn_name = self.name
@@ -88,10 +90,10 @@ class AutonomousFn(SafeFn):
88
90
 
89
91
  @property
90
92
  def fixed_kwargs(self) -> KwArgs:
91
- if not hasattr(self, "_fixed_kwargs_cached"):
93
+ if not hasattr(self, "_fixed_kwargs_cache"):
92
94
  with self.portal:
93
- self._fixed_kwargs_cached = self._fixed_kwargs_packed.unpack()
94
- return self._fixed_kwargs_cached
95
+ self._fixed_kwargs_cache = self._fixed_kwargs_packed.unpack()
96
+ return self._fixed_kwargs_cache
95
97
 
96
98
 
97
99
  def execute(self, **kwargs) -> Any:
@@ -120,9 +122,12 @@ class AutonomousFn(SafeFn):
120
122
 
121
123
  def _first_visit_to_portal(self, portal: DataPortal) -> None:
122
124
  super()._first_visit_to_portal(portal)
123
- if hasattr(self,"_fixed_kwargs_cached"):
125
+ if hasattr(self,"_fixed_kwargs_cache"):
124
126
  with portal:
125
- _ = self._fixed_kwargs_cached.pack()
127
+ for v in self._fixed_kwargs_cache.values():
128
+ if isinstance(v, PortalAwareClass):
129
+ v._first_visit_to_portal(portal)
130
+ _ = self._fixed_kwargs_cache.pack()
126
131
 
127
132
 
128
133
  def __getstate__(self):
@@ -140,7 +145,7 @@ class AutonomousFn(SafeFn):
140
145
 
141
146
  @property
142
147
  def portal(self) -> AutonomousCodePortal:
143
- return SafeFn.portal.__get__(self)
148
+ return super().portal
144
149
 
145
150
 
146
151
  def _invalidate_cache(self):
@@ -151,8 +156,8 @@ class AutonomousFn(SafeFn):
151
156
  This method should delete all such attributes.
152
157
  """
153
158
  super()._invalidate_cache()
154
- if hasattr(self, "_fixed_kwargs_cached"):
159
+ if hasattr(self, "_fixed_kwargs_cache"):
155
160
  if not hasattr(self, "_fixed_kwargs_packed"):
156
161
  raise AttributeError("Premature cache invalidation: "
157
162
  "fixed_kwargs_packed is missing.")
158
- del self._fixed_kwargs_cached
163
+ del self._fixed_kwargs_cache
@@ -48,8 +48,8 @@ class ProtectedCodePortal(AutonomousCodePortal):
48
48
 
49
49
  class ProtectedFn(AutonomousFn):
50
50
 
51
- _pre_validators_cached: list[ValidatorFn] | None
52
- _post_validators_cached: list[ValidatorFn] | None
51
+ _pre_validators_cache: list[ValidatorFn] | None
52
+ _post_validators_cache: list[ValidatorFn] | None
53
53
  _pre_validators_addrs: list[ValueAddr]
54
54
  _post_validators_addrs: list[ValueAddr]
55
55
 
@@ -84,12 +84,12 @@ class ProtectedFn(AutonomousFn):
84
84
  pre_validators = self._normalize_validators(pre_validators, PreValidatorFn)
85
85
  post_validators = self._normalize_validators(post_validators, PostValidatorFn)
86
86
 
87
- self._pre_validators_cached = pre_validators
88
- self._post_validators_cached = post_validators
87
+ self._pre_validators_cache = pre_validators
88
+ self._post_validators_cache = post_validators
89
89
  self._pre_validators_addrs = [ValueAddr(g, store=False)
90
- for g in self._pre_validators_cached]
90
+ for g in self._pre_validators_cache]
91
91
  self._post_validators_addrs = [ValueAddr(v, store=False)
92
- for v in self._post_validators_cached]
92
+ for v in self._post_validators_cache]
93
93
 
94
94
 
95
95
  def __getstate__(self):
@@ -112,27 +112,37 @@ class ProtectedFn(AutonomousFn):
112
112
  """Register an object in a portal that the object has not seen before."""
113
113
  super()._first_visit_to_portal(portal)
114
114
 
115
- if hasattr(self,"_pre_validators_cached"):
116
- with portal:
117
- _ = [ValueAddr(g) for g in self._pre_validators_cached]
115
+ for f in self.pre_validators:
116
+ f._first_visit_to_portal(portal)
117
+ for f in self.post_validators:
118
+ f._first_visit_to_portal(portal)
118
119
 
119
- if hasattr(self,"_post_validators_cached"):
120
- with portal:
121
- _ = [ValueAddr(g) for g in self._post_validators_cached]
120
+
121
+ # if hasattr(self,"_pre_validators_cache"):
122
+ # with portal:
123
+ # _ = [ValueAddr(g) for g in self._pre_validators_cache]
124
+ # else:
125
+ # raise AttributeError("Missing pre-validators: ")
126
+ #
127
+ # if hasattr(self,"_post_validators_cache"):
128
+ # with portal:
129
+ # _ = [ValueAddr(g) for g in self._post_validators_cache]
130
+ # else:
131
+ # raise AttributeError("Missing post-validators: ")
122
132
 
123
133
 
124
134
  @property
125
135
  def pre_validators(self) -> list[AutonomousFn]:
126
- if not hasattr(self, "_pre_validators_cached"):
127
- self._pre_validators_cached = [addr.get() for addr in self._pre_validators_addrs]
128
- return self._pre_validators_cached
136
+ if not hasattr(self, "_pre_validators_cache"):
137
+ self._pre_validators_cache = [addr.get() for addr in self._pre_validators_addrs]
138
+ return self._pre_validators_cache
129
139
 
130
140
 
131
141
  @property
132
142
  def post_validators(self) -> list[AutonomousFn]:
133
- if not hasattr(self, "_post_validators_cached"):
134
- self._post_validators_cached = [addr.get() for addr in self._post_validators_addrs]
135
- return self._post_validators_cached
143
+ if not hasattr(self, "_post_validators_cache"):
144
+ self._post_validators_cache = [addr.get() for addr in self._post_validators_addrs]
145
+ return self._post_validators_cache
136
146
 
137
147
 
138
148
  def can_be_executed(self, kw_args: KwArgs) -> bool:
@@ -210,7 +220,7 @@ class ProtectedFn(AutonomousFn):
210
220
 
211
221
  @property
212
222
  def portal(self) -> ProtectedCodePortal:
213
- return AutonomousFn.portal.__get__(self)
223
+ return super().portal
214
224
 
215
225
 
216
226
  def _invalidate_cache(self):
@@ -225,9 +235,9 @@ class ProtectedFn(AutonomousFn):
225
235
  if not hasattr(self, "_post_validators_addrs"):
226
236
  raise AttributeError("Premature cache invalidation: "
227
237
  "_post_validators_addrs is missing.")
228
- del self._post_validators_cached
238
+ del self._post_validators_cache
229
239
  if hasattr(self, "_pre_validators_cached"):
230
240
  if not hasattr(self, "_pre_validators_addrs"):
231
241
  raise AttributeError("Premature cache invalidation: "
232
242
  "_pre_validators_addrs is missing.")
233
- del self._pre_validators_cached
243
+ del self._pre_validators_cache
@@ -248,7 +248,7 @@ class PureFn(ProtectedFn):
248
248
 
249
249
  @property
250
250
  def portal(self) -> PureCodePortal: #*#*#
251
- return ProtectedFn.portal.__get__(self)
251
+ return super().portal
252
252
 
253
253
 
254
254
  class PureFnExecutionResultAddr(HashAddr):
File without changes