code-loader 1.0.187__py3-none-any.whl → 1.0.188.dev0__py3-none-any.whl

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.
@@ -768,18 +768,14 @@ def tensorleap_custom_metric(name: str,
768
768
 
769
769
  leap_binder.setup_container.metrics[-1].metric_handler_data.direction = effective_direction
770
770
 
771
- if compute_insights is None:
772
- effective_compute_insights = None
773
- elif isinstance(compute_insights, dict):
774
- effective_compute_insights = {key: compute_insights.get(key, True) for key in result_keys}
775
- else:
776
- effective_compute_insights = {key: compute_insights for key in result_keys}
777
-
778
- leap_binder.setup_container.metrics[-1].metric_handler_data.compute_insights = effective_compute_insights
779
-
780
771
  if defaulted_direction_keys and not _call_from_tl_platform:
781
- warning_keys = {key for key in defaulted_direction_keys
782
- if (effective_compute_insights or {}).get(key, True)}
772
+ if compute_insights is None:
773
+ effective_compute_insights = {}
774
+ elif isinstance(compute_insights, dict):
775
+ effective_compute_insights = compute_insights
776
+ else:
777
+ effective_compute_insights = {k: compute_insights for k in result_keys}
778
+ warning_keys = {key for key in defaulted_direction_keys if effective_compute_insights.get(key, True)}
783
779
  if warning_keys:
784
780
  store_warning_by_param(
785
781
  param_name=f"direction[{warning_keys}]",
code_loader/leaploader.py CHANGED
@@ -64,6 +64,9 @@ class LeapLoader(LeapLoaderBase):
64
64
  self.evaluate_module()
65
65
  if global_leap_binder.integration_test_func is not None:
66
66
  global_leap_binder.integration_test_func(None, PreprocessResponse(state=DataStateType.training, length=0))
67
+ except DatasetScriptException:
68
+ global_leap_binder.setup_container = DatasetIntegrationSetup()
69
+ raise
67
70
  except TypeError as e:
68
71
  import traceback
69
72
  global_leap_binder.setup_container = DatasetIntegrationSetup()
@@ -89,6 +92,11 @@ class LeapLoader(LeapLoaderBase):
89
92
  sys.path.append(parent_path)
90
93
 
91
94
  file_path = Path(self.code_path, self.code_entry_name)
95
+ if not file_path.is_file():
96
+ raise DatasetScriptException(
97
+ f"Entry file not found: '{self.code_entry_name}' does not exist under '{self.code_path}'. "
98
+ f"Check the 'entryFile' setting in your leap.yaml."
99
+ )
92
100
  append_path_recursively(str(file_path))
93
101
 
94
102
  importlib.invalidate_caches()
@@ -103,6 +111,13 @@ class LeapLoader(LeapLoaderBase):
103
111
 
104
112
  spec.loader.exec_module(file)
105
113
 
114
+ if global_leap_binder.setup_container.preprocess is None:
115
+ raise DatasetScriptException(
116
+ f"No Tensorleap integration found in '{self.code_entry_name}': the script never called "
117
+ f"leap_binder.set_preprocess(...). Check the 'entryFile' setting in your leap.yaml — "
118
+ f"it may be pointing to the wrong file."
119
+ )
120
+
106
121
  @lru_cache()
107
122
  def metric_by_name(self) -> Dict[str, MetricHandlerData]:
108
123
  self.exec_script()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.187
3
+ Version: 1.0.188.dev0
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -22,8 +22,8 @@ code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZ
22
22
  code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
23
23
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
24
24
  code_loader/inner_leap_binder/leapbinder.py,sha256=XLYYcV50qjMvoC1S6WW0tLBch_0g5gl1UyHiVSWYbvg,40491
25
- code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=8ob0KdvpeeNEzA3OZ4UL3dU3gigjB959zNfSvB8KHzw,118570
26
- code_loader/leaploader.py,sha256=K9Q5kiCZ_A2GkS5qOEantAMvWGaz3bmO1X8buXDSpgg,44682
25
+ code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=qfKa--0kG_K_Eb8wRd5tIXEJ6rbKva3360gU8EU9eKo,118375
26
+ code_loader/leaploader.py,sha256=qtWn_6EsKuerCcURitCsFzEk2MSoRDUlHHBM0ohI9Io,45472
27
27
  code_loader/leaploaderbase.py,sha256=l36qDA00GhZEG5NLKpEtAXgWJA-UQQIhNFGxywK7mUA,6530
28
28
  code_loader/mixpanel_tracker.py,sha256=rNwRmFifNbdUoqLQvvhhgpKczWpWiEmd8MfyJe27sxw,9131
29
29
  code_loader/plot_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -32,7 +32,7 @@ code_loader/plot_functions/visualize.py,sha256=gsBAYYkwMh7jIpJeDMPS8G4CW-pxwx6Lz
32
32
  code_loader/utils.py,sha256=YecipkdTA-VcE9F0RQcY9cFnY8P3AksPnHM2Db7xUSk,3972
33
33
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  code_loader/visualizers/default_visualizers.py,sha256=onRnLE_TXfgLN4o52hQIOOhUcFexGlqJ3xSpQDVLuZM,2604
35
- code_loader-1.0.187.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
36
- code_loader-1.0.187.dist-info/METADATA,sha256=uVGw15k07GJwz-s1QIHhL6IUkfbfDv49kUaD6YlceQI,1090
37
- code_loader-1.0.187.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
38
- code_loader-1.0.187.dist-info/RECORD,,
35
+ code_loader-1.0.188.dev0.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
36
+ code_loader-1.0.188.dev0.dist-info/METADATA,sha256=mtdX0lb1AbMGSDjxqIesGwlp3GNQoYFBcSBhIdaB8Lk,1095
37
+ code_loader-1.0.188.dev0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
38
+ code_loader-1.0.188.dev0.dist-info/RECORD,,