figpack 0.2.31__py3-none-any.whl → 0.2.32__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 figpack might be problematic. Click here for more details.

figpack/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  figpack - A Python package for creating shareable, interactive visualizations in the browser
3
3
  """
4
4
 
5
- __version__ = "0.2.31"
5
+ __version__ = "0.2.32"
6
6
 
7
7
  from .cli import view_figure
8
8
  from .core import FigpackView, FigpackExtension, ExtensionView
@@ -5,7 +5,9 @@ from ._bundle_utils import prepare_figure_bundle
5
5
  from .figpack_view import FigpackView
6
6
 
7
7
 
8
- def _save_figure(view: FigpackView, output_path: str, *, title: str):
8
+ def _save_figure(
9
+ view: FigpackView, output_path: str, *, title: str, description: str = ""
10
+ ) -> None:
9
11
  """
10
12
  Save the figure to a folder or a .tar.gz file
11
13
 
@@ -19,7 +21,7 @@ def _save_figure(view: FigpackView, output_path: str, *, title: str):
19
21
  ):
20
22
  # It's a .tar.gz file
21
23
  with tempfile.TemporaryDirectory(prefix="figpack_save_") as tmpdir:
22
- prepare_figure_bundle(view, tmpdir, title=title)
24
+ prepare_figure_bundle(view, tmpdir, title=title, description=description)
23
25
  # Create tar.gz file
24
26
  import tarfile
25
27
 
@@ -28,4 +30,6 @@ def _save_figure(view: FigpackView, output_path: str, *, title: str):
28
30
  else:
29
31
  # It's a folder
30
32
  output_path.mkdir(parents=True, exist_ok=True)
31
- prepare_figure_bundle(view, str(output_path), title=title)
33
+ prepare_figure_bundle(
34
+ view, str(output_path), title=title, description=description
35
+ )
@@ -166,7 +166,7 @@ class FigpackView:
166
166
  _local_figure_name=_local_figure_name if _dev else None,
167
167
  )
168
168
 
169
- def save(self, output_path: str, *, title: str) -> None:
169
+ def save(self, output_path: str, *, title: str, description: str = "") -> None:
170
170
  """
171
171
  Save as figure either to a folder or to a .tar.gz file
172
172
  Args:
@@ -174,7 +174,7 @@ class FigpackView:
174
174
  """
175
175
  from ._save_figure import _save_figure
176
176
 
177
- _save_figure(self, output_path, title=title)
177
+ _save_figure(self, output_path, title=title, description=description)
178
178
 
179
179
  def write_to_zarr_group(self, group: Group) -> None:
180
180
  """