code-loader 1.0.136__tar.gz → 1.0.137__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.
Potentially problematic release.
This version of code-loader might be problematic. Click here for more details.
- {code_loader-1.0.136 → code_loader-1.0.137}/PKG-INFO +1 -1
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/inner_leap_binder/leapbinder_decorators.py +16 -6
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/leaploader.py +1 -1
- {code_loader-1.0.136 → code_loader-1.0.137}/pyproject.toml +1 -1
- {code_loader-1.0.136 → code_loader-1.0.137}/LICENSE +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/README.md +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/__init__.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/contract/__init__.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/contract/datasetclasses.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/contract/enums.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/contract/exceptions.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/contract/mapping.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/contract/responsedataclasses.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/contract/visualizer_classes.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/default_losses.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/default_metrics.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/__init__.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/api.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/cli_config_utils.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/client.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/epoch.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/experiment.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/experiment_context.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/types.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/utils.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/workingspace_config_utils.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/inner_leap_binder/__init__.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/inner_leap_binder/leapbinder.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/leaploaderbase.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/mixpanel_tracker.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/plot_functions/__init__.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/plot_functions/plot_functions.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/plot_functions/visualize.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/utils.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/visualizers/__init__.py +0 -0
- {code_loader-1.0.136 → code_loader-1.0.137}/code_loader/visualizers/default_visualizers.py +0 -0
{code_loader-1.0.136 → code_loader-1.0.137}/code_loader/inner_leap_binder/leapbinder_decorators.py
RENAMED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import os
|
|
3
3
|
from collections import defaultdict
|
|
4
4
|
from functools import lru_cache
|
|
5
|
+
from pathlib import Path
|
|
5
6
|
from typing import Optional, Union, Callable, List, Dict
|
|
6
7
|
|
|
7
8
|
import numpy as np
|
|
@@ -12,7 +13,7 @@ from code_loader.contract.datasetclasses import CustomCallableInterfaceMultiArgs
|
|
|
12
13
|
VisualizerCallableInterface, MetadataSectionCallableInterface, PreprocessResponse, SectionCallableInterface, \
|
|
13
14
|
ConfusionMatrixElement, SamplePreprocessResponse, PredictionTypeHandler, InstanceCallableInterface, ElementInstance, \
|
|
14
15
|
InstanceLengthCallableInterface
|
|
15
|
-
from code_loader.contract.enums import MetricDirection, LeapDataType, DatasetMetadataType
|
|
16
|
+
from code_loader.contract.enums import MetricDirection, LeapDataType, DatasetMetadataType, DataStateType
|
|
16
17
|
from code_loader import leap_binder
|
|
17
18
|
from code_loader.contract.mapping import NodeMapping, NodeMappingType, NodeConnection
|
|
18
19
|
from code_loader.contract.visualizer_classes import LeapImage, LeapImageMask, LeapTextMask, LeapText, LeapGraph, \
|
|
@@ -44,7 +45,7 @@ def _add_mapping_connections(connects_to, arg_names, node_mapping_type, name):
|
|
|
44
45
|
_add_mapping_connection(user_unique_name, connection_destinations, arg_names, name, node_mapping_type)
|
|
45
46
|
|
|
46
47
|
|
|
47
|
-
def
|
|
48
|
+
def tensorleap_integration_test():
|
|
48
49
|
def decorating_function(integration_test_function: Callable):
|
|
49
50
|
leap_binder.integration_test_func = integration_test_function
|
|
50
51
|
|
|
@@ -56,10 +57,19 @@ def integration_test():
|
|
|
56
57
|
|
|
57
58
|
try:
|
|
58
59
|
os.environ[mapping_runtime_mode_env_var_mame] = 'True'
|
|
59
|
-
integration_test_function(None,
|
|
60
|
+
integration_test_function(None, PreprocessResponse(state=DataStateType.training, length=0))
|
|
60
61
|
except Exception as e:
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
import traceback
|
|
63
|
+
first_tb = traceback.extract_tb(e.__traceback__)[-1]
|
|
64
|
+
file_name = Path(first_tb.filename).name
|
|
65
|
+
line_number = first_tb.lineno
|
|
66
|
+
if isinstance(e, TypeError) and 'is not subscriptable' in str(e):
|
|
67
|
+
print(f'Invalid integration code. File {file_name}, line {line_number}: '
|
|
68
|
+
f'Please remove this indexing operation usage from the integration test code.')
|
|
69
|
+
else:
|
|
70
|
+
print(f'Invalid integration code. File {file_name}, line {line_number}: '
|
|
71
|
+
f'Integration test is only allowed to call Tensorleap decorators. '
|
|
72
|
+
f'Ensure any arithmetics, external library use, Python logic is placed within Tensorleap decoders')
|
|
63
73
|
finally:
|
|
64
74
|
if mapping_runtime_mode_env_var_mame in os.environ:
|
|
65
75
|
del os.environ[mapping_runtime_mode_env_var_mame]
|
|
@@ -78,7 +88,7 @@ def _safe_get_item(key):
|
|
|
78
88
|
except ValueError:
|
|
79
89
|
raise Exception(f'Tensorleap currently supports models with no more then 10 inputs')
|
|
80
90
|
|
|
81
|
-
def tensorleap_load_model(prediction_types: Optional[List[PredictionTypeHandler]] =
|
|
91
|
+
def tensorleap_load_model(prediction_types: Optional[List[PredictionTypeHandler]] = []):
|
|
82
92
|
for i, prediction_type in enumerate(prediction_types):
|
|
83
93
|
leap_binder.add_prediction(prediction_type.name, prediction_type.labels, prediction_type.channel_dim, i)
|
|
84
94
|
|
|
@@ -51,7 +51,7 @@ class LeapLoader(LeapLoaderBase):
|
|
|
51
51
|
os.environ[mapping_runtime_mode_env_var_mame] = 'TRUE'
|
|
52
52
|
self.evaluate_module()
|
|
53
53
|
if global_leap_binder.integration_test_func is not None:
|
|
54
|
-
global_leap_binder.integration_test_func(None,
|
|
54
|
+
global_leap_binder.integration_test_func(None, PreprocessResponse(state=DataStateType.training, length=0))
|
|
55
55
|
except TypeError as e:
|
|
56
56
|
import traceback
|
|
57
57
|
if "leap_binder.set_metadata(" in traceback.format_exc(5):
|
|
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
|
|
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
|
{code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/experiment_context.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_loader-1.0.136 → code_loader-1.0.137}/code_loader/experiment_api/workingspace_config_utils.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
|
|
File without changes
|
|
File without changes
|