code-loader 1.0.101__py3-none-any.whl → 1.0.102__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.

@@ -1,12 +1,27 @@
1
- import matplotlib.pyplot as plt # type: ignore
1
+
2
+ import os
3
+
4
+ from code_loader.inner_leap_binder.leapbinder import mapping_runtime_mode_env_var_mame
5
+
6
+ if not os.environ.get(mapping_runtime_mode_env_var_mame):
7
+ try:
8
+ import matplotlib.pyplot as plt # type: ignore
9
+ except ImportError:
10
+ raise ImportError(
11
+ "Matplotlib is not installed. Please install it using 'pip install matplotlib' to visualize Leap data."
12
+ )
13
+
14
+
2
15
  import numpy as np
3
- from code_loader.contract.enums import LeapDataType # type: ignore
4
- from code_loader.contract.datasetclasses import LeapData # type: ignore
16
+ from code_loader.contract.enums import LeapDataType
5
17
  from textwrap import wrap
6
18
  import math
7
19
 
20
+ from code_loader.contract.visualizer_classes import LeapImage, LeapImageWithBBox, LeapGraph, LeapText, \
21
+ LeapHorizontalBar, LeapImageMask, LeapTextMask, LeapImageWithHeatmap
22
+
8
23
 
9
- def plot_image_with_b_box(leap_data: LeapData, title: str) -> None:
24
+ def plot_image_with_b_box(leap_data: LeapImageWithBBox, title: str) -> None:
10
25
  """
11
26
  Plot an image with overlaid bounding boxes.
12
27
 
@@ -63,7 +78,7 @@ def plot_image_with_b_box(leap_data: LeapData, title: str) -> None:
63
78
  plt.show()
64
79
 
65
80
 
66
- def plot_image(leap_data: LeapData, title: str) -> None:
81
+ def plot_image(leap_data: LeapImage, title: str) -> None:
67
82
  """
68
83
  Display the image contained in the LeapImage object.
69
84
 
@@ -93,7 +108,7 @@ def plot_image(leap_data: LeapData, title: str) -> None:
93
108
  plt.show()
94
109
 
95
110
 
96
- def plot_graph(leap_data: LeapData, title: str) -> None:
111
+ def plot_graph(leap_data: LeapGraph, title: str) -> None:
97
112
  """
98
113
  Display the line chart contained in the LeapGraph object.
99
114
 
@@ -130,7 +145,7 @@ def plot_graph(leap_data: LeapData, title: str) -> None:
130
145
  plt.show()
131
146
 
132
147
 
133
- def plot_text_with_heatmap(leap_data: LeapData, title: str) -> None:
148
+ def plot_text_with_heatmap(leap_data: LeapText, title: str) -> None:
134
149
  """
135
150
  Display the text contained in the LeapText object with a heatmap overlay.
136
151
 
@@ -199,7 +214,7 @@ def plot_text_with_heatmap(leap_data: LeapData, title: str) -> None:
199
214
  plt.show()
200
215
 
201
216
 
202
- def plot_hbar(leap_data: LeapData, title: str) -> None:
217
+ def plot_hbar(leap_data: LeapHorizontalBar, title: str) -> None:
203
218
  """
204
219
  Display the horizontal bar chart contained in the LeapHorizontalBar object.
205
220
 
@@ -255,7 +270,7 @@ def plot_hbar(leap_data: LeapData, title: str) -> None:
255
270
  plt.show()
256
271
 
257
272
 
258
- def plot_image_mask(leap_data: LeapData, title: str) -> None:
273
+ def plot_image_mask(leap_data: LeapImageMask, title: str) -> None:
259
274
  """
260
275
  Plots an image with overlaid masks given a LeapImageMask visualizer object.
261
276
 
@@ -304,7 +319,7 @@ def plot_image_mask(leap_data: LeapData, title: str) -> None:
304
319
  plt.show()
305
320
 
306
321
 
307
- def plot_text_mask(leap_data: LeapData, title: str) -> None:
322
+ def plot_text_mask(leap_data: LeapTextMask, title: str) -> None:
308
323
  """
309
324
  Plots text with overlaid masks given a LeapTextMask visualizer object.
310
325
 
@@ -356,7 +371,7 @@ def plot_text_mask(leap_data: LeapData, title: str) -> None:
356
371
  plt.show()
357
372
 
358
373
 
359
- def plot_image_with_heatmap(leap_data: LeapData, title: str) -> None:
374
+ def plot_image_with_heatmap(leap_data: LeapImageWithHeatmap, title: str) -> None:
360
375
  """
361
376
  Display the image with overlaid heatmaps contained in the LeapImageWithHeatmap object.
362
377
 
@@ -1,6 +1,6 @@
1
1
  import sys
2
2
 
3
- from code_loader.contract.datasetclasses import LeapData # type: ignore
3
+ from code_loader.contract.datasetclasses import LeapData
4
4
 
5
5
  from typing import Optional
6
6
 
@@ -15,5 +15,5 @@ def visualize(leap_data: LeapData, title: Optional[str] = None) -> None:
15
15
 
16
16
  if not title:
17
17
  title = f"Leap {leap_data.type.name} Visualization"
18
- vis_function(leap_data, title)
18
+ vis_function(leap_data, title) # type: ignore[operator]
19
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.101
3
+ Version: 1.0.102
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -13,7 +13,6 @@ Classifier: Programming Language :: Python :: 3.8
13
13
  Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
- Requires-Dist: matplotlib (>=3.3.4)
17
16
  Requires-Dist: numpy (>=1.22.3,<2.0.0)
18
17
  Requires-Dist: psutil (>=5.9.5,<6.0.0)
19
18
  Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
@@ -20,8 +20,8 @@ code_loader/experiment_api/types.py,sha256=MY8xFARHwdVA7p4dxyhD60ShmttgTvb4qdp1o
20
20
  code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZJEqBqc,3304
21
21
  code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
22
22
  code_loader/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- code_loader/helpers/plot_functions.py,sha256=QyCDxWrXmqAz9jbwOcDrRZ2xXAMmzwfr1CaY5X9wcTY,13426
24
- code_loader/helpers/visualize.py,sha256=AUd5OSJs4YhL_8LJ44MQECJhsBiYfGrLk269GWhnp58,555
23
+ code_loader/helpers/plot_functions.py,sha256=FHix9_iPiFvm8cYxT1ezQ58jqxo7_uY5_FhM8T4v79Q,13911
24
+ code_loader/helpers/visualize.py,sha256=RusWyJax9qSkz2JItMb_IxOLskUvfGSWajTJHY4hCuE,565
25
25
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
26
26
  code_loader/inner_leap_binder/leapbinder.py,sha256=mi9wp98iywHedCe2GwrbiqE14zbGo1rR0huodG96ZXY,32508
27
27
  code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=j38nYWfc6yll1SMggV8gABEvSyQwEBVf5RdFnmQ1aD0,38523
@@ -30,7 +30,7 @@ code_loader/leaploaderbase.py,sha256=lKdw2pd6H9hFsxVmc7jJMoZd_vlG5He1ooqT-cR_yq8
30
30
  code_loader/utils.py,sha256=_j8b60pimoNAvWMRj7hEkkT6C76qES6cZoBFHpXHMxA,2698
31
31
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  code_loader/visualizers/default_visualizers.py,sha256=onRnLE_TXfgLN4o52hQIOOhUcFexGlqJ3xSpQDVLuZM,2604
33
- code_loader-1.0.101.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
34
- code_loader-1.0.101.dist-info/METADATA,sha256=-mfEuwf_Ltx_i9hrG3HhFwCibS1KYSvLcD3O6cwssAE,886
35
- code_loader-1.0.101.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
- code_loader-1.0.101.dist-info/RECORD,,
33
+ code_loader-1.0.102.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
34
+ code_loader-1.0.102.dist-info/METADATA,sha256=eeUs000GUbSg8MZPX3Ly4wNc_8Y_1G53yCEqD-MNACk,850
35
+ code_loader-1.0.102.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ code_loader-1.0.102.dist-info/RECORD,,