Skip to content

fzappa/WaveguideLab

Repository files navigation

WaveguideLab

TL;DR: PySide6 GUI for optical coupler simulations (powered by WaveguideModalBPM1D).

Quick start (from the repository root, with a virtual environment active):

pip install -e .
waveguidelab

For setup with uv or Python's venv, see Installation.

WaveguideLab Screenshot

Desktop application for simulating optical couplers with a graphical user interface.

This repository is intentionally focused on the interface layer. The scientific core lives in the separate package WaveguideModalBPM1D, which is declared as a dependency of this project.

Architecture

  • WaveguideLab: desktop GUI, input forms, plotting tabs, and presentation logic;
  • WaveguideModalBPM1D: modal analysis, BPM simulation, sweeps, and scientific plots.

The goal is to keep the GUI project decoupled from the scientific package so that both can evolve independently.

Requirements

  • Python 3.12 or newer
  • Optional: uv — recommended for creating the virtual environment and installing dependencies quickly

Installation

You need Python 3.12+ and a virtual environment. Pick one of the options below.

With uv (recommended)

uv manages the venv and installs dependencies from pyproject.toml. Install it once using the official installer for your OS (Windows, Linux, or macOS). After installation, open a new terminal and confirm with uv --version.

Get the project — pick one:

  • Git clone (recommended for updates and development):

    git clone https://github.com/fzappa/WaveguideLab.git
    cd WaveguideLab
  • Release archive — from GitHub Releases, download Source code (zip) or Source code (tar.gz), extract it, and open a terminal in the folder that contains pyproject.toml (often named WaveguideLab-1.x.x after extraction).

All following uv commands assume you are at that repository root.

Simplest workflow — uv creates/updates .venv and runs the app without you activating anything:

uv sync
uv run waveguidelab

uv sync reads pyproject.toml (and lockfile if present) and installs into the project’s .venv.

If you prefer activating the environment yourself — same result as above, but you run waveguidelab after activation:

uv venv

Then activate .venv and install in editable mode:

Platform Activate
Windows (PowerShell) .\.venv\Scripts\Activate.ps1
Windows (Command Prompt) .venv\Scripts\activate.bat
Linux / macOS source .venv/bin/activate
uv pip install -e .
waveguidelab

Use uv pip (not plain pip) so packages go into the environment uv created.

With pip only (no uv)

Create and activate a venv with the standard library, for example python -m venv .venv and the same activation commands as in the table above. Then:

pip install -e .
waveguidelab

pip fetches WaveguideModalBPM1D from GitHub as declared in pyproject.toml.

Linux (Ubuntu) note: install Python 3.12+ and venv if needed, e.g. sudo apt install -y python3.12 python3.12-venv, then python3.12 -m venv .venv. If your distro does not provide 3.12 in the default repos, use deadsnakes or another supported Python 3.12+ build.

Local development with both repositories

If you are developing both projects side by side:

pip install -e /path/to/WaveguideModalBPM1D
pip install -e .

Or with uv (installs into the project .venv; activate first, or run commands with uv run …):

uv pip install -e /path/to/WaveguideModalBPM1D
uv pip install -e .

This keeps WaveguideLab attached to your local editable checkout of the scientific package.

Running the application

From the repository root (with the environment active if you are not using uv run):

python main.py

If the package is already installed:

waveguidelab

Project layout

  • main.py: application entry point;
  • core.py: orchestration layer between the GUI and WaveguideModalBPM1D;
  • ui/: widgets, controls, and the main window;
  • pyproject.toml: package metadata and dependencies.

Notes about the scientific dependency

WaveguideLab expects WaveguideModalBPM1D to be importable in the current Python environment.

  • Install WaveguideModalBPM1D as a dependency;
  • Keep the GUI project independent from the scientific package internals.

This repository does not ship an in-tree copy of the scientific package. To use a local checkout during development, install it explicitly in editable mode:

pip install -e /path/to/WaveguideModalBPM1D

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only). See the LICENSE file.

About

Pyside6 optical coupler simulator

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages