pythagoras 0.8.11__tar.gz → 0.8.12__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.
- {pythagoras-0.8.11/pythagoras.egg-info → pythagoras-0.8.12}/PKG-INFO +1 -1
- pythagoras-0.8.12/pythagoras/_01_foundational_objects/__init__.py +5 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_01_foundational_objects/hash_addresses.py +2 -2
- pythagoras-0.8.11/pythagoras/_01_foundational_objects/hash_signature.py → pythagoras-0.8.12/pythagoras/_01_foundational_objects/hash_and_random_signatures.py +11 -3
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/idempotent_func_and_address.py +3 -4
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/event_logger.py +2 -3
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_06_mission_control/__events_and_exceptions_OLD__.py +3 -3
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_99_misc_utils/__init__.py +0 -3
- {pythagoras-0.8.11 → pythagoras-0.8.12/pythagoras.egg-info}/PKG-INFO +1 -1
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras.egg-info/SOURCES.txt +1 -2
- {pythagoras-0.8.11 → pythagoras-0.8.12}/setup.py +1 -1
- pythagoras-0.8.11/pythagoras/_01_foundational_objects/__init__.py +0 -5
- pythagoras-0.8.11/pythagoras/_99_misc_utils/random_safe_str_creator.py +0 -8
- {pythagoras-0.8.11 → pythagoras-0.8.12}/LICENSE +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/README.md +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pyproject.toml +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/NEW_exception_logging.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/OLD__main__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/OLD_p_cloud.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/OLD_utils.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_01_foundational_objects/value_addresses.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/__init__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/assert_ordinarity.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/check_n_positional_args.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/code_normalizer.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/code_normalizer_implementation.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/ordinary_decorator.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/ordinary_funcs.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/__init__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/autonomicity_checks.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/autonomous_decorators.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/autonomous_funcs.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/call_graph_explorer.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/default_island_singleton.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/names_usage_analyzer.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/__init__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/astkeywords_dict_convertors.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/idempotency_checks.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/idempotent_decorator.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/kw_args.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/process_augmented_func_src.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/__init__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/context_utils.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/current_date_gmt_str.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/find_in_callstack.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/notebook_checker.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/type_retrievers.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/uncaught_exception_handlers.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_06_mission_control/__init__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_06_mission_control/global_state_management.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_06_mission_control/summary.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_99_misc_utils/base_16_32_convertors.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_99_misc_utils/function_name.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_99_misc_utils/id_examiner.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_99_misc_utils/long_infoname.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_99_misc_utils/output_capturer.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_99_misc_utils/package_manager.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/NEW_hash_address.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_dependency_discovery.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_environmental.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_package_dependencies.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_persidicts.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_persiout.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_persistent_dicts.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/__init__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/test_package_dependencies.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/__init__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/__main__.py +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras.egg-info/dependency_links.txt +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras.egg-info/requires.txt +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras.egg-info/top_level.txt +0 -0
- {pythagoras-0.8.11 → pythagoras-0.8.12}/setup.cfg +0 -0
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_01_foundational_objects/hash_addresses.py
RENAMED
@@ -5,8 +5,8 @@ from typing import Any, Optional, Type, TypeVar
|
|
5
5
|
|
6
6
|
from persidict import SafeStrTuple, replace_unsafe_chars
|
7
7
|
|
8
|
-
from pythagoras.
|
9
|
-
|
8
|
+
from pythagoras._01_foundational_objects.hash_and_random_signatures import (
|
9
|
+
get_hash_signature)
|
10
10
|
|
11
11
|
T = TypeVar("T")
|
12
12
|
|
@@ -1,14 +1,16 @@
|
|
1
1
|
import sys
|
2
|
+
import uuid
|
2
3
|
from typing import Any
|
3
4
|
|
4
5
|
import joblib.hashing
|
6
|
+
|
5
7
|
from pythagoras._99_misc_utils.base_16_32_convertors import (
|
6
|
-
convert_base16_to_base32)
|
8
|
+
convert_int_to_base32, convert_base16_to_base32)
|
7
9
|
|
8
10
|
# TODO: split into a few files, add more unit-tests
|
9
11
|
|
10
12
|
hash_type: str = "sha256"
|
11
|
-
|
13
|
+
max_signature_length: int = 22
|
12
14
|
|
13
15
|
def get_base16_hash_signature(x:Any) -> str:
|
14
16
|
if 'numpy' in sys.modules:
|
@@ -26,4 +28,10 @@ def get_base32_hash_signature(x:Any) -> str:
|
|
26
28
|
|
27
29
|
|
28
30
|
def get_hash_signature(x:Any) -> str:
|
29
|
-
return get_base32_hash_signature(x)
|
31
|
+
return get_base32_hash_signature(x)[:max_signature_length]
|
32
|
+
|
33
|
+
|
34
|
+
def get_random_signature() -> str:
|
35
|
+
random_int = uuid.uuid4().int + uuid.uuid1().int
|
36
|
+
random_str = convert_int_to_base32(random_int)
|
37
|
+
return random_str[:max_signature_length]
|
@@ -4,7 +4,7 @@ import time
|
|
4
4
|
from typing import Callable, Any
|
5
5
|
|
6
6
|
import pythagoras as pth
|
7
|
-
from pythagoras import
|
7
|
+
from pythagoras import get_random_signature
|
8
8
|
|
9
9
|
from pythagoras._01_foundational_objects.hash_addresses import HashAddress
|
10
10
|
from pythagoras._01_foundational_objects.value_addresses import ValueAddress
|
@@ -116,8 +116,7 @@ class IdempotentFunction(AutonomousFunction):
|
|
116
116
|
if output_address.ready:
|
117
117
|
return output_address.get()
|
118
118
|
output_address.request_execution()
|
119
|
-
registration_addr = (output_address[
|
120
|
-
, output_address[1], get_random_safe_str())
|
119
|
+
registration_addr = (output_address[1], get_random_signature())
|
121
120
|
pth.function_execution_attempts[registration_addr] = build_context()
|
122
121
|
unpacked_kwargs = UnpackedKwArgs(**packed_kwargs)
|
123
122
|
result = super().execute(**unpacked_kwargs)
|
@@ -284,7 +283,7 @@ class FuncOutputAddress(HashAddress):
|
|
284
283
|
|
285
284
|
@property
|
286
285
|
def execution_attempts(self) -> list:
|
287
|
-
attempts = pth.function_execution_attempts.get_subdict(self)
|
286
|
+
attempts = pth.function_execution_attempts.get_subdict(self[1])
|
288
287
|
attemps_timed = {-attempts.mtimestamp(a):attempts[a] for a in attempts}
|
289
288
|
times = sorted(attemps_timed)
|
290
289
|
result = []
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/event_logger.py
RENAMED
@@ -9,8 +9,7 @@ from pythagoras._05_events_and_exceptions.find_in_callstack import (
|
|
9
9
|
find_local_var_in_callstack)
|
10
10
|
from pythagoras._05_events_and_exceptions.type_retrievers import (
|
11
11
|
retrieve_AutonomousFunction_class, retrieve_FuncOutputAddress_class)
|
12
|
-
from pythagoras
|
13
|
-
get_random_safe_str)
|
12
|
+
from pythagoras import get_random_signature
|
14
13
|
|
15
14
|
from persidict import PersiDict
|
16
15
|
import pythagoras as pth
|
@@ -55,7 +54,7 @@ def log_two_mirrored_entries(
|
|
55
54
|
island_name = func_pointer.island_name
|
56
55
|
function_name = func_pointer.f_name
|
57
56
|
|
58
|
-
event_name =
|
57
|
+
event_name = get_random_signature()
|
59
58
|
|
60
59
|
if prefix is not None:
|
61
60
|
prefixes = [prefix]
|
@@ -11,8 +11,8 @@ import pythagoras as pth
|
|
11
11
|
|
12
12
|
from datetime import datetime, timezone
|
13
13
|
|
14
|
-
from pythagoras.
|
15
|
-
|
14
|
+
from pythagoras._01_foundational_objects.hash_signature import \
|
15
|
+
get_random_signature
|
16
16
|
|
17
17
|
T = TypeVar("T")
|
18
18
|
def detect_local_variable_in_callstack(
|
@@ -156,7 +156,7 @@ def get_current_date_gmt():
|
|
156
156
|
return [year, month, day]
|
157
157
|
|
158
158
|
def post_crash_report(exception:Any, output:str=None): #TODO: refactor
|
159
|
-
crash_report_name = 'crash_' +
|
159
|
+
crash_report_name = 'crash_' + get_random_signature()
|
160
160
|
event_key = get_current_date_gmt() + [crash_report_name]
|
161
161
|
pth.global_crash_history[event_key] = ExceptionLogEntry(exception, output)
|
162
162
|
|
@@ -4,9 +4,6 @@ from pythagoras._99_misc_utils.base_16_32_convertors import (
|
|
4
4
|
from pythagoras._99_misc_utils.long_infoname import (
|
5
5
|
get_long_infoname)
|
6
6
|
|
7
|
-
from pythagoras._99_misc_utils.random_safe_str_creator import (
|
8
|
-
get_random_safe_str)
|
9
|
-
|
10
7
|
from pythagoras._99_misc_utils.package_manager import (
|
11
8
|
install_package, uninstall_package)
|
12
9
|
|
@@ -15,7 +15,7 @@ pythagoras.egg-info/requires.txt
|
|
15
15
|
pythagoras.egg-info/top_level.txt
|
16
16
|
pythagoras/_01_foundational_objects/__init__.py
|
17
17
|
pythagoras/_01_foundational_objects/hash_addresses.py
|
18
|
-
pythagoras/_01_foundational_objects/
|
18
|
+
pythagoras/_01_foundational_objects/hash_and_random_signatures.py
|
19
19
|
pythagoras/_01_foundational_objects/value_addresses.py
|
20
20
|
pythagoras/_02_ordinary_functions/__init__.py
|
21
21
|
pythagoras/_02_ordinary_functions/assert_ordinarity.py
|
@@ -57,7 +57,6 @@ pythagoras/_99_misc_utils/id_examiner.py
|
|
57
57
|
pythagoras/_99_misc_utils/long_infoname.py
|
58
58
|
pythagoras/_99_misc_utils/output_capturer.py
|
59
59
|
pythagoras/_99_misc_utils/package_manager.py
|
60
|
-
pythagoras/_99_misc_utils/random_safe_str_creator.py
|
61
60
|
pythagoras/________OLD________/NEW_hash_address.py
|
62
61
|
pythagoras/________OLD________/OLD_dependency_discovery.py
|
63
62
|
pythagoras/________OLD________/OLD_environmental.py
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_01_foundational_objects/value_addresses.py
RENAMED
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/assert_ordinarity.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/check_n_positional_args.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/code_normalizer.py
RENAMED
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_02_ordinary_functions/ordinary_decorator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/autonomicity_checks.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/autonomous_decorators.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/autonomous_funcs.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/call_graph_explorer.py
RENAMED
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_03_autonomous_functions/names_usage_analyzer.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/idempotency_checks.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_04_idempotent_functions/idempotent_decorator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/context_utils.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/current_date_gmt_str.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/find_in_callstack.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/notebook_checker.py
RENAMED
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_05_events_and_exceptions/type_retrievers.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/_06_mission_control/global_state_management.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_dependency_discovery.py
RENAMED
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_package_dependencies.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/OLD_persistent_dicts.py
RENAMED
File without changes
|
File without changes
|
{pythagoras-0.8.11 → pythagoras-0.8.12}/pythagoras/________OLD________/test_package_dependencies.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|