-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
248 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.DS_Store | ||
node_modules | ||
.venv* | ||
|
||
.ipynb_checkpoints | ||
|
||
# local env files | ||
.env.local | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## Running ParaView within Jupyter | ||
|
||
### Install packages | ||
|
||
```bash | ||
python3.9 -m venv .venv | ||
source .venv/bin/activate | ||
pip install -U pip | ||
pip install pv-visualizer | ||
pip install jupyterlab | ||
``` | ||
|
||
### Run example | ||
|
||
```bash | ||
export PYTHONPATH=/Applications/ParaView-5.10.1.app/Contents/Python | ||
export DYLD_LIBRARY_PATH=/Applications/ParaView-5.10.1.app/Contents/Libraries | ||
source .venv/bin/activate | ||
jupyter-lab | ||
``` | ||
|
||
Then in a cell | ||
|
||
```python | ||
from pv_visualizer.app.jupyter import show | ||
show() | ||
``` | ||
|
||
## Running Jupyter within ParaView | ||
|
||
This path is not yet working. |
63 changes: 63 additions & 0 deletions
63
documentation/jupyter/example/.ipynb_checkpoints/test-checkpoint.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "97651108-21d4-48dc-a322-4af0b0c8790a", | ||
"metadata": {}, | ||
"source": [ | ||
"Only run next cell to get the ENV variable to set before starting Jupyterlab after having defined TRAME_PARAVIEW=/ParaView.app/" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "383795b4-4603-4732-90a8-d2f2edbf5537", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import trame.env.paraview" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "e9d1072c-9326-48f1-bdab-26fe3331c658", | ||
"metadata": {}, | ||
"source": [ | ||
"Just run the following section once you've exported __PYTHONPATH__ and __DYLD_LIBRARY_PATH__ for mac" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "ae9f4e67-b4ab-4ea0-98e1-6c4958957b06", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pv_visualizer.app.jupyter import show\n", | ||
"\n", | ||
"show()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "97651108-21d4-48dc-a322-4af0b0c8790a", | ||
"metadata": {}, | ||
"source": [ | ||
"Only run next cell to get the ENV variable to set before starting Jupyterlab after having defined TRAME_PARAVIEW=/ParaView.app/" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "383795b4-4603-4732-90a8-d2f2edbf5537", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import trame.env.paraview" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "e9d1072c-9326-48f1-bdab-26fe3331c658", | ||
"metadata": {}, | ||
"source": [ | ||
"Just run the following section once you've exported __PYTHONPATH__ and __DYLD_LIBRARY_PATH__ for mac" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "ae9f4e67-b4ab-4ea0-98e1-6c4958957b06", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pv_visualizer.app.jupyter import show\n", | ||
"\n", | ||
"show()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
r""" | ||
Define your classes and create the instances that you need to expose | ||
""" | ||
import logging | ||
from .reactions import register_reactions | ||
from .proxymanager import ParaviewProxyManager | ||
from paraview import simple | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.INFO) | ||
|
||
# --------------------------------------------------------- | ||
# Methods | ||
# --------------------------------------------------------- | ||
|
||
|
||
def initialize(server): | ||
args, _ = server.cli.parse_known_args() | ||
# | ||
def initialize(server, plugins=None): | ||
pxm = ParaviewProxyManager() | ||
pxm.set_server(server) | ||
|
||
plugins = args.plugins.split(",") if args.plugins else [] | ||
if plugins: | ||
print("\nLoading ParaView plugins:") | ||
logger.info("\nLoading ParaView plugins:") | ||
for plugin in plugins: | ||
print(f" - {plugin}") | ||
logger.info(f" - {plugin}") | ||
simple.LoadDistributedPlugin(plugin) | ||
print() | ||
|
||
# Bind methods to controller + trigger name | ||
register_reactions(server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.