maidr 1.2.2__tar.gz → 1.3.0__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 (52) hide show
  1. {maidr-1.2.2 → maidr-1.3.0}/PKG-INFO +1 -4
  2. {maidr-1.2.2 → maidr-1.3.0}/maidr/__init__.py +1 -1
  3. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/maidr.py +12 -6
  4. {maidr-1.2.2 → maidr-1.3.0}/maidr/util/environment.py +26 -7
  5. {maidr-1.2.2 → maidr-1.3.0}/pyproject.toml +4 -4
  6. {maidr-1.2.2 → maidr-1.3.0}/LICENSE +0 -0
  7. {maidr-1.2.2 → maidr-1.3.0}/README.md +0 -0
  8. {maidr-1.2.2 → maidr-1.3.0}/maidr/api.py +0 -0
  9. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/__init__.py +0 -0
  10. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/context_manager.py +0 -0
  11. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/enum/__init__.py +0 -0
  12. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/enum/library.py +0 -0
  13. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/enum/maidr_key.py +0 -0
  14. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/enum/plot_type.py +0 -0
  15. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/enum/smooth_keywords.py +0 -0
  16. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/figure_manager.py +0 -0
  17. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/__init__.py +0 -0
  18. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/barplot.py +0 -0
  19. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/boxplot.py +0 -0
  20. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/candlestick.py +0 -0
  21. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/grouped_barplot.py +0 -0
  22. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/heatmap.py +0 -0
  23. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/histogram.py +0 -0
  24. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/lineplot.py +0 -0
  25. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/maidr_plot.py +0 -0
  26. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/maidr_plot_factory.py +0 -0
  27. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/regplot.py +0 -0
  28. {maidr-1.2.2 → maidr-1.3.0}/maidr/core/plot/scatterplot.py +0 -0
  29. {maidr-1.2.2 → maidr-1.3.0}/maidr/exception/__init__.py +0 -0
  30. {maidr-1.2.2 → maidr-1.3.0}/maidr/exception/extraction_error.py +0 -0
  31. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/__init__.py +0 -0
  32. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/barplot.py +0 -0
  33. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/boxplot.py +0 -0
  34. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/candlestick.py +0 -0
  35. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/clear.py +0 -0
  36. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/common.py +0 -0
  37. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/heatmap.py +0 -0
  38. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/highlight.py +0 -0
  39. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/histogram.py +0 -0
  40. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/kdeplot.py +0 -0
  41. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/lineplot.py +0 -0
  42. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/regplot.py +0 -0
  43. {maidr-1.2.2 → maidr-1.3.0}/maidr/patch/scatterplot.py +0 -0
  44. {maidr-1.2.2 → maidr-1.3.0}/maidr/util/__init__.py +0 -0
  45. {maidr-1.2.2 → maidr-1.3.0}/maidr/util/dedup_utils.py +0 -0
  46. {maidr-1.2.2 → maidr-1.3.0}/maidr/util/mixin/__init__.py +0 -0
  47. {maidr-1.2.2 → maidr-1.3.0}/maidr/util/mixin/extractor_mixin.py +0 -0
  48. {maidr-1.2.2 → maidr-1.3.0}/maidr/util/mixin/merger_mixin.py +0 -0
  49. {maidr-1.2.2 → maidr-1.3.0}/maidr/util/regression_line_utils.py +0 -0
  50. {maidr-1.2.2 → maidr-1.3.0}/maidr/util/svg_utils.py +0 -0
  51. {maidr-1.2.2 → maidr-1.3.0}/maidr/widget/__init__.py +0 -0
  52. {maidr-1.2.2 → maidr-1.3.0}/maidr/widget/shiny.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: maidr
3
- Version: 1.2.2
3
+ Version: 1.3.0
4
4
  Summary: Multimodal Access and Interactive Data Representations
5
5
  License: GPL-3.0-or-later
6
6
  Keywords: accessibility,visualization,sonification,braille,tactile,multimodal,data representation,blind,low vision,visual impairments
@@ -26,14 +26,11 @@ Classifier: Topic :: Scientific/Engineering :: Visualization
26
26
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
27
  Classifier: Topic :: Text Processing :: Markup :: HTML
28
28
  Requires-Dist: htmltools (>=0.5)
29
- Requires-Dist: jupyter (>=1.0.0,<2.0.0)
30
29
  Requires-Dist: lxml (>=5.1.0)
31
30
  Requires-Dist: matplotlib (>=3.8)
32
31
  Requires-Dist: mplfinance (>=0.12.10b0,<0.13.0)
33
32
  Requires-Dist: numpy (>=1.26)
34
33
  Requires-Dist: seaborn (>=0.12)
35
- Requires-Dist: statsmodels (>=0.14.4,<0.15.0)
36
- Requires-Dist: virtualenv (>=20.26.6,<21.0.0)
37
34
  Requires-Dist: wrapt (>=1.16.0,<2.0.0)
38
35
  Project-URL: Homepage, https://xability.github.io/py-maidr
39
36
  Project-URL: Repository, https://github.com/xability/py-maidr
@@ -1,4 +1,4 @@
1
- __version__ = "1.2.2"
1
+ __version__ = "1.3.0"
2
2
 
3
3
  from .api import close, render, save_html, show, stacked
4
4
  from .core import Maidr
@@ -8,7 +8,7 @@ import os
8
8
  import tempfile
9
9
  import uuid
10
10
  import webbrowser
11
- from typing import Any, Literal
11
+ from typing import Any, Literal, cast
12
12
 
13
13
  import matplotlib.pyplot as plt
14
14
  from htmltools import HTML, HTMLDocument, Tag, tags
@@ -102,14 +102,20 @@ class Maidr:
102
102
  The renderer to use for the HTML preview.
103
103
  """
104
104
  html = self._create_html_tag(use_iframe=True) # Always use iframe for display
105
- _renderer = Environment.get_renderer()
106
- if _renderer == "browser" or (
107
- Environment.is_interactive_shell() and not Environment.is_notebook()
108
- ):
105
+
106
+ # Use the passed renderer parameter, fallback to auto-detection
107
+ if renderer == "auto":
108
+ _renderer = cast(Literal["ipython", "browser"], Environment.get_renderer())
109
+ else:
110
+ _renderer = renderer
111
+
112
+ # Only try browser opening if explicitly requested as browser and not in notebook
113
+ if _renderer == "browser" and not Environment.is_notebook():
109
114
  return self._open_plot_in_browser()
115
+
110
116
  if clear_fig:
111
117
  plt.close()
112
- return html.show(renderer)
118
+ return html.show(_renderer)
113
119
 
114
120
  def clear(self):
115
121
  self._plots = []
@@ -1,5 +1,6 @@
1
1
  import json
2
2
  import os
3
+ import sys
3
4
 
4
5
 
5
6
  class Environment:
@@ -24,10 +25,19 @@ class Environment:
24
25
  try:
25
26
  from IPython import get_ipython # type: ignore
26
27
 
27
- return get_ipython() is not None and (
28
- "ipykernel" in str(get_ipython())
29
- or "google.colab" in str(get_ipython())
30
- )
28
+ ipy = get_ipython()
29
+ if ipy is not None:
30
+ # Check for Pyodide/JupyterLite specific indicators
31
+ ipy_str = str(ipy).lower()
32
+ if "pyodide" in ipy_str or "jupyterlite" in ipy_str:
33
+ return True
34
+ # Check for other notebook indicators
35
+ if "ipykernel" in str(ipy) or "google.colab" in str(ipy):
36
+ return True
37
+ # Check for Pyodide platform
38
+ if sys.platform == "emscripten":
39
+ return True
40
+ return False
31
41
  except ImportError:
32
42
  return False
33
43
 
@@ -61,10 +71,19 @@ class Environment:
61
71
  ipy = ( # pyright: ignore[reportUnknownVariableType]
62
72
  IPython.get_ipython() # pyright: ignore[reportUnknownMemberType, reportPrivateImportUsage]
63
73
  )
64
- renderer = "ipython" if ipy else "browser"
74
+ if ipy is not None:
75
+ # Check for Pyodide/JupyterLite
76
+ ipy_str = str(ipy).lower()
77
+ if "pyodide" in ipy_str or "jupyterlite" in ipy_str:
78
+ return "ipython"
79
+ # Check for Pyodide platform
80
+ if sys.platform == "emscripten":
81
+ return "ipython"
82
+ return "ipython"
83
+ else:
84
+ return "browser"
65
85
  except ImportError:
66
- renderer = "browser"
67
- return renderer
86
+ return "browser"
68
87
 
69
88
  @staticmethod
70
89
  def initialize_llm_secrets(unique_id: str) -> str:
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "maidr"
7
- version = "1.2.2"
7
+ version = "1.3.0"
8
8
  description = "Multimodal Access and Interactive Data Representations"
9
9
  authors = [
10
10
  "JooYoung Seo <jseo1005@illinois.edu>",
@@ -40,11 +40,8 @@ numpy = ">=1.26"
40
40
  seaborn = ">=0.12"
41
41
  lxml = ">=5.1.0"
42
42
  htmltools = ">=0.5"
43
- jupyter = "^1.0.0"
44
43
  wrapt = "^1.16.0"
45
- virtualenv = "^20.26.6"
46
44
  mplfinance = "^0.12.10b0"
47
- statsmodels = "^0.14.4"
48
45
 
49
46
  [tool.poetry.group.dev.dependencies]
50
47
  black = "23.3.0"
@@ -54,6 +51,9 @@ python-semantic-release = "9.21.0"
54
51
  pytest-mock = "^3.12.0"
55
52
  tox = "^4.13.0"
56
53
  quartodoc = "^0.7.5"
54
+ jupyter = "^1.0.0"
55
+ virtualenv = "^20.26.6"
56
+ statsmodels = "^0.14.4"
57
57
 
58
58
  [tool.black]
59
59
  line-length = 88
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes