Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ tauri = [
vue2 = [
"trame-grid-layout>=1.0.3",
]
jupyter = [
"jupyter-server-proxy>=4.0.0",
]


[build-system]
Expand All @@ -53,6 +56,7 @@ include = [
"/src/e3sm_quickview/data/**",
"/src/e3sm_quickview/assets/**",
"/src/e3sm_quickview/module/**",
"/src/e3sm_quickview/jupyter/**",
]

[tool.hatch.build.targets.wheel]
Expand All @@ -64,6 +68,9 @@ packages = [
quickview-vue2 = "e3sm_quickview.app:main"
quickview = "e3sm_quickview.app:main"

[project.entry-points."jupyter_serverproxy_servers"]
quickview = "e3sm_quickview.jupyter:setup_quickview"

[tool.ruff.lint.per-file-ignores]
# Ignore star import issues in ParaView plugins
"e3sm_quickview/plugins/*.py" = ["F403", "F405"]
Expand Down
5 changes: 5 additions & 0 deletions src/e3sm_quickview/jupyter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Jupyter integration for QuickView via jupyter-server-proxy."""

from .proxy import setup_quickview

__all__ = ["setup_quickview"]
Binary file added src/e3sm_quickview/jupyter/icons/quickview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/e3sm_quickview/jupyter/proxy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""Server proxy configuration for QuickView in JupyterLab."""

import os


def setup_quickview():
"""Configure jupyter-server-proxy for QuickView.

Returns a dictionary with the server process configuration that
jupyter-server-proxy uses to launch and proxy QuickView.
"""
icon_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"icons",
"quickview.png",
)

return {
"command": [
"quickview",
"--server",
"--port",
"{port}",
"--host",
"127.0.0.1",
],
"timeout": 30,
"launcher_entry": {
"enabled": True,
"title": "QuickView",
"icon_path": icon_path,
"category": "Other",
},
"new_browser_tab": False,
}
Loading