code-loader 1.0.35__py3-none-any.whl → 1.0.36.dev1__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.
@@ -89,6 +89,10 @@ class MetricHandler:
89
89
  arg_names: List[str]
90
90
  direction: Optional[MetricDirection] = MetricDirection.Downward
91
91
 
92
+ @dataclass
93
+ class RawInputsForHeatmap:
94
+ raw_input_by_vizualizer_arg_name: Dict[str, np.array]
95
+
92
96
 
93
97
  @dataclass
94
98
  class VisualizerHandler:
@@ -9,7 +9,7 @@ from code_loader.contract.datasetclasses import SectionCallableInterface, InputH
9
9
  PreprocessHandler, VisualizerCallableInterface, CustomLossHandler, CustomCallableInterface, PredictionTypeHandler, \
10
10
  MetadataSectionCallableInterface, UnlabeledDataPreprocessHandler, CustomLayerHandler, MetricHandler, \
11
11
  CustomCallableInterfaceMultiArgs, ConfusionMatrixCallableInterfaceMultiArgs, VisualizerCallableReturnType, \
12
- CustomMultipleReturnCallableInterfaceMultiArgs, DatasetBaseHandler, custom_latent_space_attribute
12
+ CustomMultipleReturnCallableInterfaceMultiArgs, DatasetBaseHandler, custom_latent_space_attribute, RawInputsForHeatmap
13
13
  from code_loader.contract.enums import LeapDataType, DataStateEnum, DataStateType, MetricDirection
14
14
  from code_loader.contract.responsedataclasses import DatasetTestResultPayload
15
15
  from code_loader.contract.visualizer_classes import map_leap_data_type_to_visualizer_class
@@ -50,10 +50,16 @@ class LeapBinder:
50
50
  heatmap_visualizer: Optional[Callable[..., npt.NDArray[np.float32]]] = None) -> None:
51
51
  arg_names = inspect.getfullargspec(function)[0]
52
52
  if heatmap_visualizer:
53
- if arg_names != inspect.getfullargspec(heatmap_visualizer)[0]:
54
- raise Exception(
55
- f'The argument names of the heatmap visualizer callback must match the visualizer callback '
56
- f'{str(arg_names)}')
53
+ visualizer_arg_names_set = set(arg_names)
54
+ heatmap_visualizer_inspection = inspect.getfullargspec(heatmap_visualizer)
55
+ heatmap_arg_names_set = set(heatmap_visualizer_inspection[0])
56
+ if visualizer_arg_names_set != heatmap_arg_names_set:
57
+ arg_names_difference = set(inspect.getfullargspec(heatmap_visualizer)[0]).difference(set(arg_names))
58
+ if len(arg_names_difference) != 1 or \
59
+ heatmap_visualizer_inspection.annotations[list(arg_names_difference)[0]] != RawInputsForHeatmap:
60
+ raise Exception(
61
+ f'The argument names of the heatmap visualizer callback must match the visualizer callback '
62
+ f'{str(arg_names)}')
57
63
 
58
64
  if visualizer_type.value not in map_leap_data_type_to_visualizer_class:
59
65
  raise Exception(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.35
3
+ Version: 1.0.36.dev1
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -2,18 +2,18 @@ LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
2
2
  code_loader/__init__.py,sha256=V3DEXSN6Ie6PlGeSAbzjp9ufRj0XPJLpD7pDLLYxk6M,122
3
3
  code_loader/code_inegration_processes_manager.py,sha256=XslWOPeNQk4RAFJ_f3tP5Oe3EgcIR7BE7Y8r9Ty73-o,3261
4
4
  code_loader/contract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- code_loader/contract/datasetclasses.py,sha256=dlLUblktFlNhQ6_6CaRiSxvrHU07fWTpnTXMPDbojUI,4599
5
+ code_loader/contract/datasetclasses.py,sha256=Vey-Q9k4s6FzuGCWERtryL44jBYsNr8pCUxqUsjYrrg,4696
6
6
  code_loader/contract/enums.py,sha256=wJSMFXL_E-JWK_XAgsqOZwOLDiRfcT_rp0oQ3P_edNI,1560
7
7
  code_loader/contract/exceptions.py,sha256=jWqu5i7t-0IG0jGRsKF4DjJdrsdpJjIYpUkN1F4RiyQ,51
8
8
  code_loader/contract/responsedataclasses.py,sha256=WSHmFZWOFhGL1eED1u-aoRotPQg2owFQ-t3xSViWXSI,2808
9
9
  code_loader/contract/visualizer_classes.py,sha256=1FjVO744J_EMuJfHWXGdvSz6vl3Vu7iS3CDfs8MzEEQ,5138
10
10
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
11
- code_loader/inner_leap_binder/leapbinder.py,sha256=JBf0iWz-3spv6ZKCvYa2aDzqatNoP6kYAfDPmNdjrHU,13078
11
+ code_loader/inner_leap_binder/leapbinder.py,sha256=cayCJxnksr5lrEIX1HngiuPpTupStti4DD6KX3k-PBI,13610
12
12
  code_loader/leaploader.py,sha256=pUySweZetJ6SsubCcZlDCJpvWmUrm5YlPlkZWQxY1hQ,17289
13
13
  code_loader/utils.py,sha256=61I4PgSl-ZBIe4DifLxMNlBELE-HQR2pB9efVYPceIU,2230
14
14
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  code_loader/visualizers/default_visualizers.py,sha256=HqWx2qfTrroGl2n8Fpmr_4X-rk7tE2oGapjO3gzz4WY,2226
16
- code_loader-1.0.35.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
17
- code_loader-1.0.35.dist-info/METADATA,sha256=77FVSzalYJVewUYCf4h1zHF0IjurHFTLgseSQ0snzxQ,768
18
- code_loader-1.0.35.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
19
- code_loader-1.0.35.dist-info/RECORD,,
16
+ code_loader-1.0.36.dev1.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
17
+ code_loader-1.0.36.dev1.dist-info/METADATA,sha256=O9W3K9okn4L95N12M_y4x9xGQYZGet7FdQ1Ljql4p24,773
18
+ code_loader-1.0.36.dev1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
19
+ code_loader-1.0.36.dev1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.8.1
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any