VisPy scene previewer for Sionna
Project description
sionna-vispy
A VisPy backend to preview Sionna scenes that works both inside and outside Jupyter Notebook.
This library consists of two parts:
- a VisPy-based
Previewerto replacesionna.rt.previewer; - and a
patch()context manager that dynamically replaces the old pythreejs previewer with the new VisPy previewer.
Installation
For the best out-of-the-box experience, we recommend
installing via Pip with recommended extras:
pip install sionna-vispy[recommended]
This will install this package, as well as PySide6 and jupyter-rfb,
so that scene.preview(...) works inside and outside Jupyter Notebooks.
Alternatively, you can install sionna-vispy with:
pip install sionna-vispy
And later install your preferred VisPy backend(s).
Usage
The VisPy scene previewer works both inside and outside Jupyter Notebooks.
First, you need to import the package (import order does not matter):
import sionna_vispy
Next, the usage of patch depends on the environment,
see the subsections.
NOTE: If
with patch():is called before any call toscene.preview(...), then you only need to callpatch()once.
Inside Notebooks[^1]
Very simply, rewrite any
scene.preview(...)
with the following:
with sionna_vispy.patch():
scene.preview()
get_canvas(scene)
WARNING: The
canvasmust be the return variable of the cell, because thewithcontext does not return an instance ofPreviewer.
[^1]: Note that you need jupyter_rfb to work inside Jupyter Notebooks.
Outside Notebooks
Canvas need to be shown and the VisPy application must be started to open a window:
with sionna_vispy.patch():
scene.preview(...)
get_canvas(scene).show()
get_canvas(scene).app.run()
How it works
This package replaces the pythreejs previewer with some
VisPy implementation by
monkey-patching
sionna.rt.scene.Previewer.
Additionally, patch() will (by default) look at
any existing sionna.rt.scene.Scene class instance in the local
namespace of the callee, and temporarily replace any
existing preview widget to make sure to use the new previewer. You can
opt-out of this by calling patch(patch_existing=False) instead.
Design goals
This package aims to be a very minimal replacement to the pythreejs previewer, with maximum compatibility.
As a result, it does not aim to provide any additional feature.
Instead, it aims at providing a very similar look to that of pythreejs, with all the nice features that come with VisPy.
Contributing
This project welcomes any contribution, and especially:
- bug fixes;
- graphical improvements to closely match the original pythreejs previewers;
- or documentation typos.
As stated above, new features are not expected to be added, unless they are also added to the original pythreejs previewer.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sionna_vispy-1.2.0.tar.gz.
File metadata
- Download URL: sionna_vispy-1.2.0.tar.gz
- Upload date:
- Size: 132.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
091317a3ddca0de853dafc9c8f5bb0398b882e51bc7a8cdfb99de8cad9abc7b7
|
|
| MD5 |
defc4d0889fd3d05262f4945687872d0
|
|
| BLAKE2b-256 |
d41d6497ff7b975fb6783cbd0de0bae2d559773c1fad6d7c54339c7dd806de99
|
Provenance
The following attestation bundles were made for sionna_vispy-1.2.0.tar.gz:
Publisher:
publish.yml on jeertmans/sionna-vispy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sionna_vispy-1.2.0.tar.gz -
Subject digest:
091317a3ddca0de853dafc9c8f5bb0398b882e51bc7a8cdfb99de8cad9abc7b7 - Sigstore transparency entry: 705340228
- Sigstore integration time:
-
Permalink:
jeertmans/sionna-vispy@ee381ca9dd1e15384231e8df75fd38ae82b1e3ea -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/jeertmans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee381ca9dd1e15384231e8df75fd38ae82b1e3ea -
Trigger Event:
push
-
Statement type:
File details
Details for the file sionna_vispy-1.2.0-py3-none-any.whl.
File metadata
- Download URL: sionna_vispy-1.2.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7909ae3d61c20a2b1e5aca5d3ac2ba0e5a6dc2dc1a588a8ad21acbce7c4f7524
|
|
| MD5 |
625cf68f45a370d859e5226bdff70f63
|
|
| BLAKE2b-256 |
ed6de033e268b9e0441d285b22be7ef4ad569469d8cdf9dfbecccaf381e52b0f
|
Provenance
The following attestation bundles were made for sionna_vispy-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on jeertmans/sionna-vispy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sionna_vispy-1.2.0-py3-none-any.whl -
Subject digest:
7909ae3d61c20a2b1e5aca5d3ac2ba0e5a6dc2dc1a588a8ad21acbce7c4f7524 - Sigstore transparency entry: 705340236
- Sigstore integration time:
-
Permalink:
jeertmans/sionna-vispy@ee381ca9dd1e15384231e8df75fd38ae82b1e3ea -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/jeertmans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee381ca9dd1e15384231e8df75fd38ae82b1e3ea -
Trigger Event:
push
-
Statement type: