hiplot-mm 0.0.2__tar.gz → 0.0.3rc0__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.
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/MANIFEST.in +1 -0
- {hiplot-mm-0.0.2/hiplot_mm.egg-info → hiplot_mm-0.0.3rc0}/PKG-INFO +53 -10
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/ipython.py +38 -6
- hiplot_mm-0.0.3rc0/hiplot/pkginfo.py +22 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/server.py +8 -2
- hiplot_mm-0.0.3rc0/hiplot/static/built/hiplot.bundle.js +3 -0
- hiplot_mm-0.0.3rc0/hiplot/static/built/streamlit_component/hiplot_streamlit.bundle.js +3 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/streamlit_helpers.py +11 -2
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0/hiplot_mm.egg-info}/PKG-INFO +53 -10
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot_mm.egg-info/SOURCES.txt +1 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot_mm.egg-info/entry_points.txt +0 -1
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot_mm.egg-info/requires.txt +18 -3
- hiplot_mm-0.0.3rc0/pyproject.toml +102 -0
- hiplot_mm-0.0.3rc0/setup.py +12 -0
- hiplot-mm-0.0.2/hiplot/pkginfo.py +0 -6
- hiplot-mm-0.0.2/hiplot/static/built/hiplot.bundle.js +0 -3
- hiplot-mm-0.0.2/hiplot/static/built/streamlit_component/hiplot_streamlit.bundle.js +0 -3
- hiplot-mm-0.0.2/setup.py +0 -58
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/LICENSE +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/NOTICE +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/README.md +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/__init__.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/__main__.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/compress.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/experiment.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/fetchers.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/fetchers_demo.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/py.typed +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/render.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/static/built/streamlit_component/index.html +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/static/icon-w.svg +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/static/icon.png +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/static/icon.svg +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/static/logo-w.svg +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/static/logo.png +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/static/logo.svg +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/static/thumbnail.png +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/templates/index.html +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/test_experiment.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/test_fetchers.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot/test_render.py +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot_mm.egg-info/dependency_links.txt +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/hiplot_mm.egg-info/top_level.txt +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/requirements/dev.txt +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/requirements/main.txt +0 -0
- {hiplot-mm-0.0.2 → hiplot_mm-0.0.3rc0}/setup.cfg +0 -0
|
@@ -1,16 +1,61 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: hiplot-mm
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3rc0
|
|
4
4
|
Summary: High dimensional Interactive Plotting tool
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
Author: Facebook AI Research, mathematicalmichael @ Mind the Math, LLC
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/facebookresearch/hiplot
|
|
8
|
+
Project-URL: Documentation, https://facebookresearch.github.io/hiplot/
|
|
9
|
+
Project-URL: Repository, https://github.com/facebookresearch/hiplot
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
23
|
+
Requires-Python: >=3.8
|
|
10
24
|
Description-Content-Type: text/markdown
|
|
11
|
-
Provides-Extra: dev
|
|
12
25
|
License-File: LICENSE
|
|
13
26
|
License-File: NOTICE
|
|
27
|
+
Requires-Dist: beautifulsoup4
|
|
28
|
+
Requires-Dist: jinja2
|
|
29
|
+
Provides-Extra: server
|
|
30
|
+
Requires-Dist: flask; extra == "server"
|
|
31
|
+
Requires-Dist: flask-compress; extra == "server"
|
|
32
|
+
Provides-Extra: notebook
|
|
33
|
+
Requires-Dist: ipython>=7.0.1; extra == "notebook"
|
|
34
|
+
Requires-Dist: ipykernel; extra == "notebook"
|
|
35
|
+
Provides-Extra: streamlit
|
|
36
|
+
Requires-Dist: streamlit>=0.63; extra == "streamlit"
|
|
37
|
+
Provides-Extra: all
|
|
38
|
+
Requires-Dist: hiplot-mm[notebook,server,streamlit]; extra == "all"
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: pytest; extra == "dev"
|
|
41
|
+
Requires-Dist: mypy; extra == "dev"
|
|
42
|
+
Requires-Dist: ipykernel; extra == "dev"
|
|
43
|
+
Requires-Dist: wheel; extra == "dev"
|
|
44
|
+
Requires-Dist: selenium; extra == "dev"
|
|
45
|
+
Requires-Dist: mistune==0.8.4; extra == "dev"
|
|
46
|
+
Requires-Dist: twine; extra == "dev"
|
|
47
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
48
|
+
Requires-Dist: pandas; extra == "dev"
|
|
49
|
+
Requires-Dist: streamlit>=0.63; extra == "dev"
|
|
50
|
+
Requires-Dist: beautifulsoup4; extra == "dev"
|
|
51
|
+
Requires-Dist: optuna; extra == "dev"
|
|
52
|
+
Requires-Dist: sphinx==5.2.0; extra == "dev"
|
|
53
|
+
Requires-Dist: guzzle_sphinx_theme==0.7.11; extra == "dev"
|
|
54
|
+
Requires-Dist: m2r2==0.3.3; extra == "dev"
|
|
55
|
+
Requires-Dist: flask; extra == "dev"
|
|
56
|
+
Requires-Dist: flask-compress; extra == "dev"
|
|
57
|
+
Requires-Dist: ipython>=7.0.1; extra == "dev"
|
|
58
|
+
Dynamic: license-file
|
|
14
59
|
|
|
15
60
|
# HiPlot - High dimensional Interactive Plotting [](https://circleci.com/gh/facebookresearch/hiplot/tree/main)
|
|
16
61
|
|
|
@@ -83,5 +128,3 @@ External contributors (*please add your name when you submit your first pull req
|
|
|
83
128
|
|
|
84
129
|
## License
|
|
85
130
|
HiPlot is [MIT](LICENSE) licensed, as found in the [LICENSE](LICENSE) file.
|
|
86
|
-
|
|
87
|
-
|
|
@@ -8,11 +8,38 @@ import typing as t
|
|
|
8
8
|
import json
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
|
-
import IPython.display
|
|
12
|
-
from ipykernel.comm import Comm
|
|
13
11
|
from . import experiment as exp
|
|
14
12
|
from .render import escapejs, make_experiment_standalone_page
|
|
15
13
|
|
|
14
|
+
# Lazy imports for optional dependencies
|
|
15
|
+
if t.TYPE_CHECKING:
|
|
16
|
+
import IPython.display
|
|
17
|
+
from ipykernel.comm import Comm
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _get_ipython_display() -> t.Any:
|
|
21
|
+
"""Lazy import of IPython.display with helpful error message."""
|
|
22
|
+
try:
|
|
23
|
+
import IPython.display
|
|
24
|
+
return IPython.display
|
|
25
|
+
except ImportError as e:
|
|
26
|
+
raise ImportError(
|
|
27
|
+
"IPython is required for notebook support. "
|
|
28
|
+
"Install it with: pip install hiplot-mm[notebook]"
|
|
29
|
+
) from e
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _get_comm_class() -> t.Any:
|
|
33
|
+
"""Lazy import of ipykernel.comm.Comm with helpful error message."""
|
|
34
|
+
try:
|
|
35
|
+
from ipykernel.comm import Comm
|
|
36
|
+
return Comm
|
|
37
|
+
except ImportError as e:
|
|
38
|
+
raise ImportError(
|
|
39
|
+
"ipykernel is required for notebook support. "
|
|
40
|
+
"Install it with: pip install hiplot-mm[notebook]"
|
|
41
|
+
) from e
|
|
42
|
+
|
|
16
43
|
|
|
17
44
|
class GetSelectedFailure(Exception):
|
|
18
45
|
pass
|
|
@@ -27,8 +54,9 @@ class NotebookJSBundleInjector:
|
|
|
27
54
|
|
|
28
55
|
@classmethod
|
|
29
56
|
def ensure_injected(cls) -> None:
|
|
57
|
+
IPython_display = _get_ipython_display()
|
|
30
58
|
bundle = Path(__file__).parent / "static" / "built" / "hiplot.bundle.js"
|
|
31
|
-
|
|
59
|
+
IPython_display.display(IPython_display.Javascript(f"""
|
|
32
60
|
{bundle.read_text("utf-8")}
|
|
33
61
|
// Local variables can't be accessed in other cells, so let's
|
|
34
62
|
// manually create a global variable
|
|
@@ -76,7 +104,9 @@ class IPythonExperimentDisplayed(exp.ExperimentDisplayed):
|
|
|
76
104
|
self._selected_ids: t.List[str] = []
|
|
77
105
|
self._last_data_per_type: t.Dict[str, t.Any] = {}
|
|
78
106
|
|
|
79
|
-
|
|
107
|
+
Comm = _get_comm_class()
|
|
108
|
+
|
|
109
|
+
def target_func(comm: "Comm", open_msg: t.Dict[str, t.Any]) -> None: # pylint: disable=unused-argument
|
|
80
110
|
# comm is the kernel Comm instance
|
|
81
111
|
# msg is the comm_open message
|
|
82
112
|
|
|
@@ -89,7 +119,7 @@ class IPythonExperimentDisplayed(exp.ExperimentDisplayed):
|
|
|
89
119
|
self._last_data_per_type[msg_data["type"]] = msg_data["data"]
|
|
90
120
|
|
|
91
121
|
try:
|
|
92
|
-
ip: Any = get_ipython() # type: ignore # pylint: disable=undefined-variable
|
|
122
|
+
ip: t.Any = get_ipython() # type: ignore # pylint: disable=undefined-variable
|
|
93
123
|
ip.kernel.comm_manager.register_target(comm_name, target_func)
|
|
94
124
|
except NameError: # NameError: name 'get_ipython' is not defined
|
|
95
125
|
# We are not in an ipython environment - for example in testing
|
|
@@ -133,6 +163,8 @@ def display_exp(
|
|
|
133
163
|
embed_js_with_html: t.Optional[bool] = None,
|
|
134
164
|
**kwargs: t.Any
|
|
135
165
|
) -> IPythonExperimentDisplayed:
|
|
166
|
+
IPython_display = _get_ipython_display()
|
|
167
|
+
|
|
136
168
|
if embed_js_with_html is None:
|
|
137
169
|
embed_js_with_html = _should_embed_js_with_html()
|
|
138
170
|
|
|
@@ -185,5 +217,5 @@ catch(err) {{
|
|
|
185
217
|
else:
|
|
186
218
|
NotebookJSBundleInjector.ensure_injected()
|
|
187
219
|
|
|
188
|
-
|
|
220
|
+
IPython_display.display(IPython_display.HTML(index_html))
|
|
189
221
|
return displayed_xp
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
2
|
+
# This source code is licensed under the MIT license found in the
|
|
3
|
+
# LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
package_name = "hiplot-mm"
|
|
6
|
+
|
|
7
|
+
# Dynamic version from installed package metadata
|
|
8
|
+
# This ensures __version__ matches pyproject.toml when installed via pip
|
|
9
|
+
try:
|
|
10
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
11
|
+
try:
|
|
12
|
+
version = version(package_name)
|
|
13
|
+
except PackageNotFoundError:
|
|
14
|
+
# Package is not installed (e.g., running from source checkout)
|
|
15
|
+
version = "0.0.0.dev0"
|
|
16
|
+
except ImportError:
|
|
17
|
+
# Python < 3.8 fallback
|
|
18
|
+
try:
|
|
19
|
+
import importlib_metadata
|
|
20
|
+
version = importlib_metadata.version(package_name)
|
|
21
|
+
except Exception:
|
|
22
|
+
version = "0.0.0.dev0"
|
|
@@ -18,8 +18,14 @@ def run_server(fetchers: List[exp.ExperimentFetcher], host: str = '127.0.0.1', p
|
|
|
18
18
|
"""
|
|
19
19
|
Runs the HiPlot server, given a list of ExperimentFetchers - functions that convert a URI into a :class:`hiplot.Experiment`
|
|
20
20
|
"""
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
try:
|
|
22
|
+
from flask import Flask, render_template, jsonify, request
|
|
23
|
+
from flask_compress import Compress
|
|
24
|
+
except ImportError as e:
|
|
25
|
+
raise ImportError(
|
|
26
|
+
"Flask is required to run the HiPlot server. "
|
|
27
|
+
"Install it with: pip install hiplot-mm[server]"
|
|
28
|
+
) from e
|
|
23
29
|
|
|
24
30
|
app = Flask(__name__)
|
|
25
31
|
|