{"id":15621644,"url":"https://github.com/jeertmans/sionna-vispy","last_synced_at":"2025-04-28T16:16:05.912Z","repository":{"id":244410140,"uuid":"815166499","full_name":"jeertmans/sionna-vispy","owner":"jeertmans","description":"VisPy preview backend for Sionna","archived":false,"fork":false,"pushed_at":"2025-04-21T18:30:38.000Z","size":38,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T00:57:57.481Z","etag":null,"topics":["backed","preview","raytracing","sionna","vispy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeertmans.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-14T13:48:30.000Z","updated_at":"2025-03-09T02:19:42.000Z","dependencies_parsed_at":"2024-09-10T00:24:34.274Z","dependency_job_id":"df535302-702f-4360-8637-b1ce8be17a7f","html_url":"https://github.com/jeertmans/sionna-vispy","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"96796ece943f00d67a75c44defba054052f17785"},"previous_names":["jeertmans/sionna-vispy"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fsionna-vispy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fsionna-vispy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fsionna-vispy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fsionna-vispy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeertmans","download_url":"https://codeload.github.com/jeertmans/sionna-vispy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342725,"owners_count":21574245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backed","preview","raytracing","sionna","vispy"],"created_at":"2024-10-03T09:51:23.070Z","updated_at":"2025-04-28T16:16:05.894Z","avatar_url":"https://github.com/jeertmans.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sionna-vispy\n\n[![Latest Release][pypi-version-badge]][pypi-version-url]\n[![Python version][pypi-python-version-badge]][pypi-version-url]\n\nA [VisPy](https://github.com/vispy/vispy)\nbackend to preview\n[Sionna](https://github.com/NVlabs/sionna) scenes\nthat works both inside and **outside** Jupyter Notebook.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Example VisPy canvas\" width=\"480\" src=\"https://github.com/user-attachments/assets/04195e43-674b-43d6-8422-baf3d4dc572d\"\u003e\n\u003c/p\u003e\n\nThis library consists of two parts:\n\n1. a VisPy-based `InteractiveDisplay` to replace `sionna.rt.previewer`;\n2. and a `patch()` context manager that dynamically replaces\n  the old pythreejs previewer with the new VisPy previewer.\n\n## Installation\n\nFor the best out-of-the-box experience, we recommend\ninstalling via Pip with `recommended` extras:\n\n```bash\npip install sionna-vispy[recommended]\n```\n\nThis will install this package, as well as PySide6 and jupyter-rfb,\nso that `scene.preview(...)` works inside and **outside** Jupyter Notebooks.\n\nAlternatively, you can install sionna-vispy with:\n\n```bash\npip install sionna-vispy\n```\n\nAnd later install your preferred\n[VisPy backend(s)](https://vispy.org/installation.html).\n\n## Usage\n\nThe VisPy scene previewer works both\ninside and **outside** Jupyter Notebooks.\n\nFirst, you need to import the package (import order does not matter):\n\n```python\nimport sionna_vispy\n```\n\nNext, the usage of `patch` depends on the environment,\nsee the subsections.\n\n\u003e [!NOTE]\n\u003e If `with patch():` is called before any\n\u003e call to `scene.preview(...)`,\n\u003e then you only need to call\n\u003e `patch()` once.\n\n### Inside Notebooks[^1]\n\nVery simply, rewrite any\n\n```python\nscene.preview(...)\n```\n\nwith the following:\n\n```python\nwith sionna_vispy.patch():\n    canvas = scene.preview()\n\ncanvas\n```\n\n\u003e [!WARNING]\n\u003e `canvas` must be the return variable\n\u003e of the cell, because the `with` context\n\u003e does not return an instance of\n\u003e `InteractiveDisplay`.\n\n[^1]: Note that you need `jupyter_rfb` to work inside Jupyter Notebooks.\n\n### Outside Notebooks\n\nCanvas need to be *shown* and the VisPy application\nmust be started to open a window:\n\n```python\nwith sionna_vispy.patch():\n    canvas = scene.preview(...)\n\ncanvas.show()\ncanvas.app.run()\n```\n\n## How it works\n\nThis package replaces the pythreejs previewer with some\nVisPy implementation by\n[*monkey-patching*](https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch)\n`sionna.rt.scene.InteractiveDisplay`.\n\nAdditionally, `patch()` will (by default) look at\nany existing `sionna.rt.scene.Scene` class instance in the local\nnamespace of the callee, and temporarily replace any\nexisting preview widget to make sure to use the new previewer. You can\nopt-out of this by calling `patch(patch_existing=False)` instead.\n\n## Design goals\n\nThis package aims to be a very minimal replacement to the pythreejs\npreviewer, with maximum compatibility.\n\nAs a result, **it does not aim to provide any additional feature**.\n\nInstead, it aims at providing a very similar look to that of\npythreejs, with all the nice features that come with VisPy.\n\n## Contributing\n\nThis project welcomes any contribution, and especially:\n\n+ bug fixes;\n+ graphical improvements to closely match the original pythreejs previewers;\n+ or documentation typos.\n\nAs stated above, new features are not expected to be added, unless they are also\nadded to the original pythreejs previewer.\n\n[pypi-version-badge]: https://img.shields.io/pypi/v/sionna-vispy?label=sionna-vispy\n[pypi-version-url]: https://pypi.org/project/sionna-vispy/\n[pypi-python-version-badge]: https://img.shields.io/pypi/pyversions/sionna-vispy\n[pypi-download-badge]: https://img.shields.io/pypi/dm/sionna-vispy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeertmans%2Fsionna-vispy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeertmans%2Fsionna-vispy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeertmans%2Fsionna-vispy/lists"}