pythagoras 0.24.1__tar.gz → 0.24.2__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 (77) hide show
  1. {pythagoras-0.24.1 → pythagoras-0.24.2}/PKG-INFO +1 -1
  2. {pythagoras-0.24.1 → pythagoras-0.24.2}/pyproject.toml +1 -1
  3. {pythagoras-0.24.1/src/pythagoras/_070_protected_code_portals → pythagoras-0.24.2/src/pythagoras}/.DS_Store +0 -0
  4. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_010_basic_portals/basic_portal_core_classes.py +10 -17
  5. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_030_data_portals/data_portal_core_classes.py +13 -13
  6. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/logging_portal_core_classes.py +3 -3
  7. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_080_pure_code_portals/recursion_pre_validator.py +5 -9
  8. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_090_swarming_portals/swarming_portals.py +1 -1
  9. pythagoras-0.24.1/src/pythagoras/.DS_Store +0 -0
  10. pythagoras-0.24.1/src/pythagoras/_010_basic_portals/.DS_Store +0 -0
  11. pythagoras-0.24.1/src/pythagoras/_020_ordinary_code_portals/.DS_Store +0 -0
  12. pythagoras-0.24.1/src/pythagoras/_030_data_portals/.DS_Store +0 -0
  13. pythagoras-0.24.1/src/pythagoras/_040_logging_code_portals/.DS_Store +0 -0
  14. pythagoras-0.24.1/src/pythagoras/_050_safe_code_portals/.DS_Store +0 -0
  15. pythagoras-0.24.1/src/pythagoras/_060_autonomous_code_portals/.DS_Store +0 -0
  16. pythagoras-0.24.1/src/pythagoras/_080_pure_code_portals/.DS_Store +0 -0
  17. pythagoras-0.24.1/src/pythagoras/_090_swarming_portals/.DS_Store +0 -0
  18. pythagoras-0.24.1/src/pythagoras/_100_top_level_API/.DS_Store +0 -0
  19. pythagoras-0.24.1/src/pythagoras/_800_signatures_and_converters/.DS_Store +0 -0
  20. pythagoras-0.24.1/src/pythagoras/_900_project_stats_collector/.DS_Store +0 -0
  21. {pythagoras-0.24.1 → pythagoras-0.24.2}/README.md +0 -0
  22. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_010_basic_portals/__init__.py +0 -0
  23. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_010_basic_portals/exceptions.py +0 -0
  24. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_010_basic_portals/long_infoname.py +0 -0
  25. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_010_basic_portals/not_picklable_class.py +0 -0
  26. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_010_basic_portals/portal_tester.py +0 -0
  27. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_010_basic_portals/post_init_metaclass.py +0 -0
  28. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_020_ordinary_code_portals/__init__.py +0 -0
  29. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_020_ordinary_code_portals/code_normalizer.py +0 -0
  30. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_020_ordinary_code_portals/function_processing.py +0 -0
  31. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_020_ordinary_code_portals/ordinary_decorator.py +0 -0
  32. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_020_ordinary_code_portals/ordinary_portal_core_classes.py +0 -0
  33. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_030_data_portals/__init__.py +0 -0
  34. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_030_data_portals/ready_and_get.py +0 -0
  35. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_030_data_portals/storable_decorator.py +0 -0
  36. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/__init__.py +0 -0
  37. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/exception_processing_tracking.py +0 -0
  38. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/execution_environment_summary.py +0 -0
  39. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/kw_args.py +0 -0
  40. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/logging_decorator.py +0 -0
  41. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/notebook_checker.py +0 -0
  42. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/output_capturer.py +0 -0
  43. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_040_logging_code_portals/uncaught_exceptions.py +0 -0
  44. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_050_safe_code_portals/__init__.py +0 -0
  45. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_050_safe_code_portals/safe_decorator.py +0 -0
  46. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_050_safe_code_portals/safe_portal_core_classes.py +0 -0
  47. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_060_autonomous_code_portals/__init__.py +0 -0
  48. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_060_autonomous_code_portals/autonomous_decorators.py +0 -0
  49. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_060_autonomous_code_portals/autonomous_portal_core_classes.py +0 -0
  50. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_060_autonomous_code_portals/names_usage_analyzer.py +0 -0
  51. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/__init__.py +0 -0
  52. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/basic_pre_validators.py +0 -0
  53. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/fn_arg_names_checker.py +0 -0
  54. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/list_flattener.py +0 -0
  55. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/package_manager.py +0 -0
  56. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/protected_decorators.py +0 -0
  57. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/protected_portal_core_classes.py +0 -0
  58. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/system_utils.py +0 -0
  59. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_070_protected_code_portals/validation_succesful_const.py +0 -0
  60. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_080_pure_code_portals/__init__.py +0 -0
  61. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_080_pure_code_portals/pure_core_classes.py +0 -0
  62. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_080_pure_code_portals/pure_decorator.py +0 -0
  63. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_090_swarming_portals/__init__.py +0 -0
  64. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_090_swarming_portals/output_suppressor.py +0 -0
  65. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_100_top_level_API/__init__.py +0 -0
  66. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_100_top_level_API/default_local_portal.py +0 -0
  67. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_100_top_level_API/top_level_API.py +0 -0
  68. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_800_signatures_and_converters/__init__.py +0 -0
  69. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_800_signatures_and_converters/base_16_32_convertors.py +0 -0
  70. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_800_signatures_and_converters/current_date_gmt_str.py +0 -0
  71. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_800_signatures_and_converters/hash_signatures.py +0 -0
  72. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_800_signatures_and_converters/node_signature.py +0 -0
  73. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_800_signatures_and_converters/random_signatures.py +0 -0
  74. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_900_project_stats_collector/__init__.py +0 -0
  75. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/_900_project_stats_collector/project_analyzer.py +0 -0
  76. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/__init__.py +0 -0
  77. {pythagoras-0.24.1 → pythagoras-0.24.2}/src/pythagoras/core/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pythagoras
3
- Version: 0.24.1
3
+ Version: 0.24.2
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.24.1"
7
+ version = "0.24.2"
8
8
  authors = [
9
9
  {name = "Volodymyr (Vlad) Pavlov", email = "vlpavlov@ieee.org"},
10
10
  ]
@@ -359,15 +359,15 @@ class BasicPortal(NotPicklable,ParameterizableClass, metaclass = PostInitMeta):
359
359
  return sorted_params
360
360
 
361
361
 
362
- @property
363
- def _ephemeral_param_names(self) -> set[str]:
364
- """Get the names of the portal's ephemeral parameters.
365
-
366
- Portal's ephemeral parameters are not stored persistently.
367
- They affect behaviour of a portal object in an application session,
368
- but they do not affect behaviour of the actual portal across multiple runs.
369
- """
370
- return set()
362
+ # @property
363
+ # def auxiliary_param_names(self) -> set[str]:
364
+ # """Get the names of the portal's ephemeral parameters.
365
+ #
366
+ # Portal's ephemeral parameters are not stored persistently.
367
+ # They affect behaviour of a portal object in an application session,
368
+ # but they do not affect behaviour of the actual portal across multiple runs.
369
+ # """
370
+ # return set()
371
371
 
372
372
 
373
373
  @property
@@ -377,15 +377,8 @@ class BasicPortal(NotPicklable,ParameterizableClass, metaclass = PostInitMeta):
377
377
  It's an internal hash used by Pythagoras and is different from .__hash__()
378
378
  """
379
379
  if not hasattr(self,"_str_id_cache"):
380
- params = self.get_params()
381
- jsparams = parameterizable.dumpjs(params)
382
- param_names = set(params.keys())
383
- params = parameterizable.access_jsparams(jsparams, *param_names)
384
- ephemeral_names = self._ephemeral_param_names
385
- nonephemeral_params = {k:params[k] for k in params
386
- if k not in ephemeral_names}
387
380
  self._str_id_cache = PortalStrID(
388
- get_hash_signature(nonephemeral_params))
381
+ get_hash_signature(self.get_essential_jsparams()))
389
382
  return self._str_id_cache
390
383
 
391
384
 
@@ -61,7 +61,7 @@ class DataPortal(OrdinaryCodePortal):
61
61
  _config_settings: PersiDict | None
62
62
  _config_settings_cache: dict
63
63
 
64
- _ephemeral_config_params_at_init: dict[str, Any] | None
64
+ _auxiliary_config_params_at_init: dict[str, Any] | None
65
65
 
66
66
  def __init__(self
67
67
  , root_dict: PersiDict|str|None = None
@@ -69,7 +69,7 @@ class DataPortal(OrdinaryCodePortal):
69
69
  ):
70
70
  OrdinaryCodePortal.__init__(self, root_dict = root_dict)
71
71
  del root_dict
72
- self._ephemeral_config_params_at_init = dict()
72
+ self._auxiliary_config_params_at_init = dict()
73
73
  self._config_settings_cache = dict()
74
74
 
75
75
  config_settings_prototype = self._root_dict.get_subdict("config_settings")
@@ -84,7 +84,7 @@ class DataPortal(OrdinaryCodePortal):
84
84
  raise ValueError("p_consistency_checks must be a float in [0,1] "
85
85
  +f"or a Joker, but got {p_consistency_checks}")
86
86
 
87
- self._ephemeral_config_params_at_init["p_consistency_checks"
87
+ self._auxiliary_config_params_at_init["p_consistency_checks"
88
88
  ] = p_consistency_checks
89
89
 
90
90
  value_store_prototype = self._root_dict.get_subdict("value_store")
@@ -97,7 +97,7 @@ class DataPortal(OrdinaryCodePortal):
97
97
 
98
98
 
99
99
  def _persist_initial_config_params(self) -> None:
100
- for key, value in self._ephemeral_config_params_at_init.items():
100
+ for key, value in self._auxiliary_config_params_at_init.items():
101
101
  self._set_config_setting(key, value)
102
102
 
103
103
 
@@ -111,15 +111,15 @@ class DataPortal(OrdinaryCodePortal):
111
111
  def get_params(self) -> dict:
112
112
  """Get the portal's configuration parameters"""
113
113
  params = super().get_params()
114
- params.update(self._ephemeral_config_params_at_init)
114
+ params.update(self._auxiliary_config_params_at_init)
115
115
  sorted_params = sort_dict_by_keys(params)
116
116
  return sorted_params
117
117
 
118
118
 
119
119
  @property
120
- def _ephemeral_param_names(self) -> set[str]:
121
- names = super()._ephemeral_param_names
122
- names.update(self._ephemeral_config_params_at_init)
120
+ def auxiliary_param_names(self) -> set[str]:
121
+ names = super().auxiliary_param_names
122
+ names.update(self._auxiliary_config_params_at_init)
123
123
  return names
124
124
 
125
125
 
@@ -186,7 +186,7 @@ class DataPortal(OrdinaryCodePortal):
186
186
  """Clear the portal's state"""
187
187
  self._value_store = None
188
188
  self._config_settings = None
189
- self._ephemeral_config_params_at_init = None
189
+ self._auxiliary_config_params_at_init = None
190
190
  self._invalidate_cache()
191
191
  super()._clear()
192
192
 
@@ -195,14 +195,14 @@ class StorableFn(OrdinaryFn):
195
195
  """An ordinary function that can be persistently stored in a DataPortal."""
196
196
 
197
197
  _addr_cache: ValueAddr
198
- _ephemeral_config_params_at_init: dict[str, Any] | None
198
+ _auxiliary_config_params_at_init: dict[str, Any] | None
199
199
 
200
200
  def __init__(self
201
201
  , fn: Callable | str
202
202
  , portal: DataPortal | None = None
203
203
  ):
204
204
  OrdinaryFn.__init__(self, fn=fn, portal=portal)
205
- self._ephemeral_config_params_at_init = dict()
205
+ self._auxiliary_config_params_at_init = dict()
206
206
 
207
207
 
208
208
  def _first_visit_to_portal(self, portal: DataPortal) -> None:
@@ -213,7 +213,7 @@ class StorableFn(OrdinaryFn):
213
213
 
214
214
 
215
215
  def _persist_initial_config_params(self, portal:DataPortal) -> None:
216
- for key, value in self._ephemeral_config_params_at_init.items():
216
+ for key, value in self._auxiliary_config_params_at_init.items():
217
217
  self._set_config_setting(key, value, portal)
218
218
 
219
219
 
@@ -268,7 +268,7 @@ class StorableFn(OrdinaryFn):
268
268
  def __setstate__(self, state):
269
269
  """This method is called when the object is unpickled."""
270
270
  super().__setstate__(state)
271
- self._ephemeral_config_params_at_init = dict()
271
+ self._auxiliary_config_params_at_init = dict()
272
272
 
273
273
 
274
274
  def __getstate__(self):
@@ -48,9 +48,9 @@ class LoggingFn(StorableFn):
48
48
  f"got {type(excessive_logging)}")
49
49
 
50
50
  if excessive_logging is KEEP_CURRENT and isinstance(fn, LoggingFn):
51
- excessive_logging = fn._ephemeral_config_params_at_init["excessive_logging"]
51
+ excessive_logging = fn._auxiliary_config_params_at_init["excessive_logging"]
52
52
 
53
- self._ephemeral_config_params_at_init[
53
+ self._auxiliary_config_params_at_init[
54
54
  "excessive_logging"] = excessive_logging
55
55
 
56
56
 
@@ -545,7 +545,7 @@ class LoggingCodePortal(DataPortal):
545
545
  "excessive_logging must be a boolean or Joker, "
546
546
  f"got {type(excessive_logging)}")
547
547
 
548
- self._ephemeral_config_params_at_init["excessive_logging"
548
+ self._auxiliary_config_params_at_init["excessive_logging"
549
549
  ] = excessive_logging
550
550
 
551
551
  crash_history_prototype = self._root_dict.get_subdict("crash_history")
@@ -20,17 +20,12 @@ def _recursion_pre_validator(
20
20
  param_value = unpacked_kwargs[param_name]
21
21
  assert isinstance(param_value, int)
22
22
  assert param_value >= 0
23
- if param_value in {0,1,2,3,4}:
23
+ if param_value in {0,1}:
24
24
  return pth.VALIDATION_SUCCESSFUL
25
- unpacked_kwargs[param_name] = param_value - 1
26
- result_addr = pth.PureFnExecutionResultAddr(
27
- fn=fn, arguments=unpacked_kwargs)
28
- if result_addr.ready:
29
- return pth.VALIDATION_SUCCESSFUL
30
- result = result_addr.call_signature
31
-
25
+
32
26
  # Binary search to find the smallest n where result_addr.ready is not True
33
- left, right = 2, param_value - 2
27
+ left, right = 2, param_value - 1
28
+ result = pth.VALIDATION_SUCCESSFUL # Default result if all are ready
34
29
 
35
30
  while left <= right:
36
31
  mid = (left + right) // 2
@@ -47,6 +42,7 @@ def _recursion_pre_validator(
47
42
  # Result is ready, search in the right half
48
43
  left = mid + 1
49
44
 
45
+
50
46
  return result
51
47
 
52
48
 
@@ -72,7 +72,7 @@ class SwarmingPortal(PureCodePortal):
72
72
  if parent_process_id is None or parent_process_start_time is None:
73
73
  assert parent_process_id is None
74
74
  assert parent_process_start_time is None
75
- self._ephemeral_config_params_at_init["max_n_workers"
75
+ self._auxiliary_config_params_at_init["max_n_workers"
76
76
  ] = max_n_workers
77
77
  else:
78
78
  assert max_n_workers == 0
Binary file
File without changes