code-loader 1.0.78__py3-none-any.whl → 1.0.79__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.
@@ -103,7 +103,17 @@ class LeapBinder:
103
103
  heatmap_visualizer=image_resize_heatmap_visualizer
104
104
  )
105
105
  """
106
- arg_names = inspect.getfullargspec(function)[0]
106
+
107
+ regular_arg_names = inspect.getfullargspec(function)[0]
108
+ preprocess_response_arg_name = None
109
+ for arg_name, arg_type in inspect.getfullargspec(function).annotations.items():
110
+ if arg_type == SamplePreprocessResponse:
111
+ if preprocess_response_arg_name is not None:
112
+ raise Exception("only one argument can be of type SamplePreprocessResponse")
113
+ preprocess_response_arg_name = arg_name
114
+ regular_arg_names.remove(arg_name)
115
+
116
+ arg_names = regular_arg_names
107
117
  if heatmap_visualizer:
108
118
  visualizer_arg_names_set = set(arg_names)
109
119
  heatmap_visualizer_inspection = inspect.getfullargspec(heatmap_visualizer)
@@ -282,8 +292,17 @@ class LeapBinder:
282
292
 
283
293
  leap_binder.add_custom_metric(custom_metric_function, name='custom_metric', direction=MetricDirection.Downward)
284
294
  """
285
- arg_names = inspect.getfullargspec(function)[0]
286
- metric_handler_data = MetricHandlerData(name, arg_names, direction, compute_insights)
295
+
296
+ regular_arg_names = inspect.getfullargspec(function)[0]
297
+ preprocess_response_arg_name = None
298
+ for arg_name, arg_type in inspect.getfullargspec(function).annotations.items():
299
+ if arg_type == SamplePreprocessResponse:
300
+ if preprocess_response_arg_name is not None:
301
+ raise Exception("only one argument can be of type SamplePreprocessResponse")
302
+ preprocess_response_arg_name = arg_name
303
+ regular_arg_names.remove(arg_name)
304
+
305
+ metric_handler_data = MetricHandlerData(name, regular_arg_names, direction, compute_insights)
287
306
  self.setup_container.metrics.append(MetricHandler(metric_handler_data, function))
288
307
 
289
308
  def add_prediction(self, name: str, labels: List[str], channel_dim: int = -1) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.78
3
+ Version: 1.0.79
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -19,14 +19,14 @@ code_loader/experiment_api/types.py,sha256=MY8xFARHwdVA7p4dxyhD60ShmttgTvb4qdp1o
19
19
  code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZJEqBqc,3304
20
20
  code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
21
21
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
22
- code_loader/inner_leap_binder/leapbinder.py,sha256=3C8Vzk-O2opVQ5FU16uX7GM57RX64mziMiyW6h3fRgo,29367
22
+ code_loader/inner_leap_binder/leapbinder.py,sha256=qLKZchPBchlSnzEQDd7I9x8JqHip04okbUoaEqq9lIk,30333
23
23
  code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=HUIVrI-I0aB-nQl7lZErE5vuhml7A8MMGaw_R4U4QCk,22053
24
24
  code_loader/leaploader.py,sha256=AUx6iqJK9DzIrdDGvfM3cWNejoK7aDTsU_ShhphVrfM,25679
25
25
  code_loader/leaploaderbase.py,sha256=VH0vddRmkqLtcDlYPCO7hfz1_VbKo43lUdHDAbd4iJc,4198
26
26
  code_loader/utils.py,sha256=aw2i_fqW_ADjLB66FWZd9DfpCQ7mPdMyauROC5Nd51I,2197
27
27
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  code_loader/visualizers/default_visualizers.py,sha256=Ffx5VHVOe5ujBOsjBSxN_aIEVwFSQ6gbhTMG5aUS-po,2305
29
- code_loader-1.0.78.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
30
- code_loader-1.0.78.dist-info/METADATA,sha256=EfiPvcKzkE4v7DblDFb6-kpVDBXz_pquAep0j7FTAQ4,849
31
- code_loader-1.0.78.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
- code_loader-1.0.78.dist-info/RECORD,,
29
+ code_loader-1.0.79.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
30
+ code_loader-1.0.79.dist-info/METADATA,sha256=h8ws4SPUcqT6B5n3mcLSShNUw5QZYJNTqiuZ27yFGCQ,849
31
+ code_loader-1.0.79.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
+ code_loader-1.0.79.dist-info/RECORD,,