maxplotlibx 0.1.5__tar.gz → 0.1.6__tar.gz

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.
Files changed (37) hide show
  1. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/PKG-INFO +1 -1
  2. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/pyproject.toml +1 -1
  3. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/canvas/canvas.py +18 -1
  4. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_canvas.py +24 -1
  5. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/PKG-INFO +1 -1
  6. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/LICENSE +0 -0
  7. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/README.md +0 -0
  8. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/setup.cfg +0 -0
  9. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/__init__.py +0 -0
  10. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/matplotlib/utils.py +0 -0
  11. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/plotext/__init__.py +0 -0
  12. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/plotext/figure.py +0 -0
  13. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/plotly/__init__.py +0 -0
  14. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/plotly/utils.py +0 -0
  15. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/canvas/__init__.py +0 -0
  16. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/colors/__init__.py +0 -0
  17. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/colors/colors.py +0 -0
  18. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/linestyle/__init__.py +0 -0
  19. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/linestyle/linestyle.py +0 -0
  20. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/objects/__init__.py +0 -0
  21. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/objects/node.py +0 -0
  22. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/objects/path.py +0 -0
  23. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/subfigure/__init__.py +0 -0
  24. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/subfigure/line_plot.py +0 -0
  25. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/subfigure/subfigure.py +0 -0
  26. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_flame_chart.py +0 -0
  27. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_gantt_chart.py +0 -0
  28. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_imports.py +0 -0
  29. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_plot.py +0 -0
  30. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_plotext.py +0 -0
  31. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_plotly_backend.py +0 -0
  32. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/utils/__init__.py +0 -0
  33. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/utils/options.py +0 -0
  34. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/SOURCES.txt +0 -0
  35. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/dependency_links.txt +0 -0
  36. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/requires.txt +0 -0
  37. {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maxplotlibx
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: A reproducible plotting module with various backends and export options.
5
5
  Author: Max
6
6
  Project-URL: Source, https://github.com/max-models/maxplotlib
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maxplotlibx"
7
- version = "0.1.5"
7
+ version = "0.1.6"
8
8
  description = "A reproducible plotting module with various backends and export options."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -946,7 +946,24 @@ class Canvas:
946
946
  layers: list | None = None,
947
947
  usetex: bool | None = None,
948
948
  verbose: bool = False,
949
+ block: bool = True,
949
950
  ):
951
+ """
952
+ Render and display the canvas.
953
+
954
+ Parameters
955
+ ----------
956
+ block : bool, optional
957
+ matplotlib backend only (default: True). Whether to block until
958
+ the figure window is closed before returning. Passed straight to
959
+ ``plt.show(block=...)`` rather than left at its default, because
960
+ that default follows ``matplotlib.is_interactive()`` -- which
961
+ other imported code (IPython, a prior interactive session) can
962
+ flip to True behind this call's back, silently turning off
963
+ blocking. Forcing it explicitly is what makes repeated
964
+ ``canvas.show()`` calls in a loop display one figure at a time
965
+ instead of every window appearing together.
966
+ """
950
967
  if verbose:
951
968
  print(f"Showing canvas using backend: {backend}")
952
969
 
@@ -962,7 +979,7 @@ class Canvas:
962
979
  )
963
980
  if verbose:
964
981
  print("Displaying Matplotlib figure...")
965
- plt.show()
982
+ plt.show(block=block)
966
983
  return fig, axes
967
984
  elif backend == "plotly":
968
985
  resolved_usetex = self._usetex if usetex is None else usetex
@@ -347,11 +347,34 @@ def test_canvas_show_uses_matplotlib_show(monkeypatch):
347
347
 
348
348
  fig, axes = canvas.show()
349
349
 
350
- assert calls == [((), {})]
350
+ # block=True is passed explicitly (not left at plt.show()'s own default)
351
+ # so a caller looping over several canvases shows them one at a time
352
+ # regardless of matplotlib's interactive-mode state.
353
+ assert calls == [((), {"block": True})]
351
354
  assert fig is not None
352
355
  assert axes is not None
353
356
 
354
357
 
358
+ def test_canvas_show_block_false_is_forwarded(monkeypatch):
359
+ import matplotlib.pyplot as plt
360
+
361
+ from maxplotlib import Canvas
362
+
363
+ calls = []
364
+
365
+ monkeypatch.setattr(
366
+ plt, "show", lambda *args, **kwargs: calls.append((args, kwargs))
367
+ )
368
+
369
+ canvas = Canvas()
370
+ subplot = canvas.add_subplot()
371
+ subplot.plot([0, 1], [0, 1])
372
+
373
+ canvas.show(block=False)
374
+
375
+ assert calls == [((), {"block": False})]
376
+
377
+
355
378
  def test_show_canvas_script_invokes_canvas_show(monkeypatch):
356
379
  import maxplotlib
357
380
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maxplotlibx
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: A reproducible plotting module with various backends and export options.
5
5
  Author: Max
6
6
  Project-URL: Source, https://github.com/max-models/maxplotlib
File without changes
File without changes
File without changes