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
InteractiveDisplay
to 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():
canvas = scene.preview()
canvas
WARNING:
canvas
must be the return variable of the cell, because thewith
context does not return an instance ofInteractiveDisplay
.
[^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():
canvas = scene.preview(...)
canvas.show()
canvas.app.run()
How it works
This package replaces the pythreejs previewer with some
VisPy implementation by
monkey-patching
sionna.rt.scene.InteractiveDisplay
.
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
Release history Release notifications | RSS feed
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
File details
Details for the file sionna_vispy-0.19.0.tar.gz
.
File metadata
- Download URL: sionna_vispy-0.19.0.tar.gz
- Upload date:
- Size: 121.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95277cbe265635e92aa7d83f9b405cdcdf7b343be22bc08a0943676b9762affa |
|
MD5 | df7a71e16d133c1d29658f89a7a2e043 |
|
BLAKE2b-256 | 10fe01adddc07c1538735552ee494681898a114256df3844b4ea0077d3f3ad2d |
Provenance
The following attestation bundles were made for sionna_vispy-0.19.0.tar.gz
:
Publisher:
publish.yml
on jeertmans/sionna-vispy
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
sionna_vispy-0.19.0.tar.gz
- Subject digest:
95277cbe265635e92aa7d83f9b405cdcdf7b343be22bc08a0943676b9762affa
- Sigstore transparency entry: 148675763
- Sigstore integration time:
- Predicate type:
File details
Details for the file sionna_vispy-0.19.0-py3-none-any.whl
.
File metadata
- Download URL: sionna_vispy-0.19.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07c5eaefb4b817b633c786d8e2f0e4c1ed6a81034d3620b07b55fedc05564447 |
|
MD5 | 0750c04fb86278dcbb2a874b2a95429d |
|
BLAKE2b-256 | 7457877c2a1578cfce0c0148405dda9f293191667c7321a88b562aea527f0aa9 |
Provenance
The following attestation bundles were made for sionna_vispy-0.19.0-py3-none-any.whl
:
Publisher:
publish.yml
on jeertmans/sionna-vispy
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
sionna_vispy-0.19.0-py3-none-any.whl
- Subject digest:
07c5eaefb4b817b633c786d8e2f0e4c1ed6a81034d3620b07b55fedc05564447
- Sigstore transparency entry: 148675768
- Sigstore integration time:
- Predicate type: