Advanced automation for PLECS simulations with a web UI, REST API, and orchestration tools.
This repository contains the PyPLECS core library, a FastAPI-based web GUI for monitoring and controlling simulations, and helper installers/scripts to bootstrap a development or deployment environment.
- Automated orchestration of PLECS simulations (sequential and parallel)
- FastAPI web GUI with WebSocket real-time updates
- Cache system for simulation results (file-based / parquet)
- CLI helper
pyplecs-setupfor configuration and environment checks - Windows installer script to create a
.venv, install deps and configure the PLECS executable path
- Python 3.8+ (3.10+ recommended)
- On Windows: PowerShell / pwsh available for installer scripts
- PLECS (external, optional) if you want to run GUI-driven simulations
Core Python dependencies are listed in requirements.txt and in pyproject.toml.
Two main ways to prepare the project environment: automated (Windows) or manual (cross-platform).
The repository includes an advanced installer at tools/installers/windows_installer.ps1 that will:
- Create a
.venvin the project root - Install required Python packages into the venv
- Probe common PLECS install locations and update
config/default.ymlwith the found executable path - Optionally run a basic test suite to validate the setup
Run non-interactively from the project root (PowerShell):
pwsh -NoProfile -ExecutionPolicy Bypass -File .\tools\installers\windows_installer.ps1 -YesTo force recreation of the .venv, add the -ForceVenv switch:
pwsh -NoProfile -ExecutionPolicy Bypass -File .\tools\installers\windows_installer.ps1 -Yes -ForceVenvInstaller logs are written to tools/installer_windows.log and status JSON to tools/installer_windows_status.json.
- Create and activate a virtual environment in the project root:
python -m venv .venv
# On Linux/macOS
source .venv/bin/activate
# On Windows (PowerShell)
.venv\Scripts\Activate.ps1- Install dependencies:
pip install --upgrade pip
pip install -r requirements.txt- (Optional) Install the package in editable mode for development:
pip install -e .- Verify the virtual environment exists and
pythonresolves to.venv's interpreter. - Basic check: run the web GUI locally (see Usage below).
- Use
pyplecs-setupCLI (installed viapyproject.tomlentry points) for convenience commands:
python -m pyplecs.cli.installer create-config
python -m pyplecs.cli.installer check-windowsThe lightweight starter script is start_webgui.py at the project root. Run it from the project root (with the .venv active):
python start_webgui.pyDefault server address: http://127.0.0.1:8001
Available pages:
/- Dashboard/simulations- Simulation manager/cache- Cache monitor/settings- Configuration (PLECS paths, orchestration settings)
pyplecs-setup(entry point) provides helper tasks such as creating a minimalconfig/default.ymland running platform checks.
The primary configuration file is config/default.yml. The Windows installer can populate the plecs.executable_paths entry. Example minimal config written by the installer:
plecs:
executable_paths:
- 'C:\\Program Files\\Plexim\\PLECS 4.7 (64 bit)\\plecs.exe'Other application settings are stored centrally and loaded via pyplecs.config.
The project includes pytest tests under tests/. Run the full test suite with the venv Python:
.venv\Scripts\Activate.ps1 # Windows PowerShell
python -m pytest -qFor a quick installation validation without GUI dependencies, run the smoke test:
python -m pytest tests/test_smoke.py -vThe Windows installer offers an option to run pytest tests/test_basic.py to validate integration.
If you get a PLECS executable not found error, update the path in config/default.yml:
plecs:
executable_paths:
- "C:/Program Files/Plexim/PLECS 4.7 (64 bit)/plecs.exe" # Update to your versionYou can add multiple paths for different PLECS versions:
plecs:
executable_paths:
- "D:/OneDrive/Documenti/Plexim/PLECS 4.7 (64 bit)/plecs.exe"
- "C:/Program Files/Plexim/PLECS 4.7 (64 bit)/plecs.exe"
- "C:/Program Files/Plexim/PLECS 4.6 (64 bit)/plecs.exe".venvnot present: ensure the installer was run from the project root. The installer will create.venvin the repository root. Use-ForceVenvto recreate.- Missing Python packages (ImportError): activate the venv and run
pip install -r requirements.txt. - Installer logs:
tools/installer_windows.logandtools/installer_windows_status.jsoncontain detailed outcomes and error codes.
Common error codes (written in status JSON):
venv_creation_failed/venv_creation_exception- venv creation failedpip_install_failed/pip_install_exception- dependency installation failedplecs_path_invalid- supplied PLECS path could not be found
If you need interactive help on Windows, run the PowerShell installer without -Yes to use prompts.
Contributions welcome. Please open issues or pull requests. Follow these guidelines:
- Run tests before pushing changes:
python -m pytest - Keep code style with
blackandflake8as configured inrequirements.txt - Update
docs/PROGRESS_MEMO.mdwith high-level progress notes for large changes
This project is licensed under the terms in the LICENSE file.
If you want, I can also generate a short Quick Start section with example commands tailored to Windows or Linux — tell me which platform you'd like prioritized.