code-loader 1.0.118.dev2__py3-none-any.whl → 1.0.118.dev3__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.

Potentially problematic release.


This version of code-loader might be problematic. Click here for more details.

code_loader/leaploader.py CHANGED
@@ -34,7 +34,7 @@ class LeapLoader(LeapLoaderBase):
34
34
  super().__init__(code_path, code_entry_name)
35
35
 
36
36
  self._preprocess_result_cached = None
37
-
37
+
38
38
  try:
39
39
  from code_loader.mixpanel_tracker import track_code_loader_loaded
40
40
  track_code_loader_loaded({
@@ -165,7 +165,9 @@ class LeapLoader(LeapLoaderBase):
165
165
 
166
166
  custom_latent_space = None
167
167
  if global_leap_binder.setup_container.custom_latent_space is not None:
168
- custom_latent_space = global_leap_binder.setup_container.custom_latent_space.function(sample_id, preprocess_result[state])
168
+ custom_latent_space = global_leap_binder.setup_container.custom_latent_space.function(sample_id,
169
+ preprocess_result[
170
+ state])
169
171
 
170
172
  sample = DatasetSample(inputs=self._get_inputs(state, sample_id),
171
173
  gt=None if state == DataStateEnum.unlabeled else self._get_gt(state, sample_id),
@@ -216,8 +218,6 @@ class LeapLoader(LeapLoaderBase):
216
218
  general_error = f"Something went wrong. {repr(e.__cause__)} in file {file_name}, line_number: {line_number}\nStacktrace:\n{stacktrace}"
217
219
  is_valid = False
218
220
 
219
-
220
-
221
221
  print_log = stdout_steam.getvalue()
222
222
  is_valid_for_model = bool(global_leap_binder.setup_container.custom_layers)
223
223
  model_setup = self.get_model_setup_response()
@@ -482,7 +482,8 @@ class LeapLoader(LeapLoaderBase):
482
482
  def _get_inputs(self, state: DataStateEnum, sample_id: Union[int, str]) -> Dict[str, npt.NDArray[np.float32]]:
483
483
  return self._get_dataset_handlers(global_leap_binder.setup_container.inputs, state, sample_id)
484
484
 
485
- def _get_instances_masks(self, state: DataStateEnum, sample_id: Union[int, str]) -> Dict[str, List[ElementInstance]]:
485
+ def _get_instances_masks(self, state: DataStateEnum, sample_id: Union[int, str]) -> Dict[
486
+ str, List[ElementInstance]]:
486
487
  preprocess_result = self._preprocess_result()
487
488
  preprocess_state = preprocess_result[state]
488
489
  result_agg = {}
@@ -532,7 +533,8 @@ class LeapLoader(LeapLoaderBase):
532
533
 
533
534
  return converted_value, is_none
534
535
 
535
- def _get_metadata(self, state: DataStateEnum, sample_id: Union[int, str]) -> Tuple[Dict[str, Union[str, int, bool, float]], Dict[str, bool]]:
536
+ def _get_metadata(self, state: DataStateEnum, sample_id: Union[int, str]) -> Tuple[
537
+ Dict[str, Union[str, int, bool, float]], Dict[str, bool]]:
536
538
  result_agg = {}
537
539
  is_none = {}
538
540
  preprocess_result = self._preprocess_result()
@@ -561,6 +563,11 @@ class LeapLoader(LeapLoaderBase):
561
563
 
562
564
  return id_type
563
565
 
566
+ @lru_cache()
567
+ def has_custom_latent_space_decorator(self) -> bool:
568
+ self.exec_script()
569
+ return global_leap_binder.setup_container.custom_latent_space is not None
570
+
564
571
  def get_instances_data(self, state: DataStateEnum) -> Tuple[Dict[str, List[str]], Dict[str, str], Dict[str, str]]:
565
572
  """
566
573
  This Method get the data state and returns two dictionaries that holds the mapping of the sample ids to their
@@ -114,6 +114,10 @@ class LeapLoaderBase:
114
114
  def get_sample_id_type(self) -> Type:
115
115
  pass
116
116
 
117
+ @abstractmethod
118
+ def has_custom_latent_space_decorator(self) -> bool:
119
+ pass
120
+
117
121
  @abstractmethod
118
122
  def get_heatmap_visualizer_raw_vis_input_arg_name(self, visualizer_name: str) -> Optional[str]:
119
123
  pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.118.dev2
3
+ Version: 1.0.118.dev3
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/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaS
22
22
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
23
23
  code_loader/inner_leap_binder/leapbinder.py,sha256=Q3D9yVM-GNEJfYRFvMV__BoZbcWOgnWKhrZXAv6Tu7o,33232
24
24
  code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=QpM0gx8ZplGp2XykZXBk0QBh2_5fqW9cgLNOoM4Sacs,42948
25
- code_loader/leaploader.py,sha256=xym-Pl8nT_iV-1cA5iXr-BZbqAhYOu-vbcwyv3nSCa4,30063
26
- code_loader/leaploaderbase.py,sha256=lKdw2pd6H9hFsxVmc7jJMoZd_vlG5He1ooqT-cR_yq8,4496
25
+ code_loader/leaploader.py,sha256=6bHLWsGISU23oF5ATKNtdCZjo4kBjboUUs3G00EGERA,30456
26
+ code_loader/leaploaderbase.py,sha256=-FAJUQlgDTI4QwJP8lwgwEFVOlnwCRi3-nSvPruCVGU,4587
27
27
  code_loader/mixpanel_tracker.py,sha256=U20vQXH8G7XIVXxcpQcVEZSuIwwGnyH5RMHXWZZG8HI,4639
28
28
  code_loader/plot_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  code_loader/plot_functions/plot_functions.py,sha256=xg6Gi4myTN9crq6JtyrhYI38HLXjPVJcbnI7CIy8f7w,14625
@@ -31,7 +31,7 @@ code_loader/plot_functions/visualize.py,sha256=gsBAYYkwMh7jIpJeDMPS8G4CW-pxwx6Lz
31
31
  code_loader/utils.py,sha256=_j8b60pimoNAvWMRj7hEkkT6C76qES6cZoBFHpXHMxA,2698
32
32
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  code_loader/visualizers/default_visualizers.py,sha256=onRnLE_TXfgLN4o52hQIOOhUcFexGlqJ3xSpQDVLuZM,2604
34
- code_loader-1.0.118.dev2.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
35
- code_loader-1.0.118.dev2.dist-info/METADATA,sha256=DPZQTmlglWeE5wDy7VPnOjgpoqWa_YpmUTsFT5_MWzA,1095
36
- code_loader-1.0.118.dev2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
37
- code_loader-1.0.118.dev2.dist-info/RECORD,,
34
+ code_loader-1.0.118.dev3.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
35
+ code_loader-1.0.118.dev3.dist-info/METADATA,sha256=vO2N-sbB_C59fjc7fd54toJbgO_IvMVfyDdVg9yR0bQ,1095
36
+ code_loader-1.0.118.dev3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
37
+ code_loader-1.0.118.dev3.dist-info/RECORD,,