A Python package for visualizing SPICE simulation waveforms in Jupyter notebooks
Project description
Wave View
A Python package for visualizing SPICE simulation waveforms with interactive Plotly-based plotting, designed for seamless integration with Jupyter notebooks.
โจ Features
- ๐ Interactive Plotly Visualization: Modern, web-based plots with zoom, pan, and hover
- ๐ง Simple API: Plot waveforms with a single function call
- โ๏ธ YAML Configuration: Flexible, reusable plotting configurations
- ๐ค Case-Insensitive Signal Access: Access signals regardless of case (
V(VDD)=v(vdd)) - ๐งฎ Processed Signals: Generate derived signals with lambda functions
- ๐ Jupyter-First Design: Auto-detection and inline plotting
- ๐๏ธ Advanced Plotting: Full control with
SpicePlotterclass - ๐ Template Generation: Auto-create configurations from SPICE files
๐ Quick Start
Installation
Option 1: Install from PyPI (Coming Soon)
pip install wave_view
Option 2: Install from GitHub (Latest)
# Install latest version directly from GitHub
pip install git+https://github.com/jianxun/wave_view.git
# Or install a specific branch/tag
pip install git+https://github.com/jianxun/wave_view.git@main
pip install git+https://github.com/jianxun/wave_view.git@v0.1.0
Option 3: Development Installation
# Clone the repository
git clone https://github.com/jianxun/wave_view.git
cd wave_view
# Create and activate virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode (editable install)
pip install -e .
# Install development dependencies (optional)
pip install -r requirements-dev.txt
Verify Installation
python -c "import wave_view as wv; print(f'Wave View {wv.__version__} installed successfully!')"
Basic Usage
import wave_view as wv
# Simple plotting - just provide a SPICE file
fig = wv.plot("simulation.raw")
# With configuration file
fig = wv.plot("simulation.raw", "config.yaml")
# Direct configuration
config = wv.config_from_yaml("""
title: "Voltage Analysis"
X:
signal_key: "time"
label: "Time (s)"
Y:
- label: "Voltage (V)"
signals:
VDD: "v(vdd)"
OUT: "v(vout)"
IN: "v(vin)"
""")
fig = wv.plot("simulation.raw", config)
Advanced Usage
import wave_view as wv
# Load SPICE data
data = wv.load_spice("simulation.raw")
print(f"Found {len(data.signals)} signals")
# Advanced plotting with SpicePlotter
plotter = wv.SpicePlotter("simulation.raw")
# Add processed signals
plotter.add_processed_signal("power", lambda d: d["v(vdd)"] * d["i(vdd)"])
# Load configuration and plot
plotter.load_config("plot_config.yaml")
fig = plotter.create_figure()
๐ Documentation
Configuration Format
Wave View uses YAML configuration files for flexible plotting:
title: "Voltage Analysis"
X:
signal_key: "time"
label: "Time (s)"
Y:
- label: "Supply Voltages (V)"
signals:
VDD: "v(vdd)"
VSS: "v(vss)"
- label: "Signal Voltages (V)"
signals:
OUT: "v(vout)"
IN: "v(vin)"
Configuration Validation
Validate your configurations before plotting:
# Validate configuration
config = wv.config_from_yaml("""
title: "My Plot"
X:
signal_key: "time"
Y:
- signals:
OUT: "v(out)"
""")
warnings = wv.validate_config(config)
if warnings:
print("Warnings:", warnings)
Jupyter Integration
Wave View automatically detects Jupyter environments and displays plots inline:
# In Jupyter notebook - displays automatically
wv.plot("simulation.raw")
# Manual renderer control
wv.set_renderer("notebook") # or "browser", "png", etc.
๐ Examples
The examples/ directory contains:
examples/scripts/: Python script examplesexamples/notebooks/: Jupyter notebook tutorialsexamples/data/: Sample SPICE files for testing
๐ ๏ธ Development
Setup Development Environment
# Clone the repository
git clone https://github.com/your-username/wave_view.git
cd wave_view
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode with all dependencies
pip install -e .
pip install -r requirements-dev.txt
# Verify development setup
python -c "import wave_view as wv; print('Development setup complete!')"
Run Tests
# Run all tests
pytest
# With coverage
pytest --cov=wave_view --cov-report=html
# Run specific test file
pytest tests/test_basic.py -v
Code Quality
# Format code
black src/ tests/
# Sort imports
isort src/ tests/
# Lint code
flake8 src/ tests/
# Type checking
mypy src/
๐๏ธ Project Structure
wave_view/
โโโ src/wave_view/ # Main package
โ โโโ core/ # Core functionality
โ โ โโโ reader.py # SPICE file reading
โ โ โโโ config.py # Configuration handling
โ โ โโโ plotter.py # Plotting logic
โ โโโ utils/ # Utility functions
โ โโโ api.py # Main API
โโโ tests/ # Test suite
โโโ examples/ # Usage examples
โโโ docs/ # Documentation
โโโ pyproject.toml # Package configuration
๐ Requirements
- Python: 3.8+
- Core Dependencies:
plotly>= 5.0.0 (Interactive plotting)numpy>= 1.20.0 (Numerical operations)PyYAML>= 6.0 (Configuration files)spicelib>= 1.0.0 (SPICE file reading)
๐ค Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Ensure all tests pass (
pytest) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Documentation
Comprehensive documentation is available with:
- User Guides: Installation, quickstart, and configuration
- API Reference: Complete function documentation
- Examples: Practical use cases and tutorials
- Development: Contributing guidelines and setup
Build Documentation Locally
# Install documentation dependencies
pip install -e ".[docs]"
# Build documentation
make docs
# Serve documentation locally
make docs-serve # Opens at http://localhost:8000
๐ Links
- Documentation: [Local Build Available]
- PyPI Package: [Coming Soon]
- Issue Tracker: GitHub Issues
- Changelog: CHANGELOG.md
๐ท๏ธ Version
Current version: 0.1.0 (Alpha)
Wave View - Making SPICE waveform visualization simple and interactive! ๐๐
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 wave_view-0.1.0.tar.gz.
File metadata
- Download URL: wave_view-0.1.0.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1907e6b45acbff27e7646445c82666e4af20ffacc4845d24b3c5f3f550737bd
|
|
| MD5 |
05dfc938d78dadc63ffecb7a0ae1a732
|
|
| BLAKE2b-256 |
c2136e0964a6d272e35adab0c1197ae3c4c0c933c52029e7f7bc247e8f9f056b
|
Provenance
The following attestation bundles were made for wave_view-0.1.0.tar.gz:
Publisher:
publish.yml on Jianxun/wave_view
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wave_view-0.1.0.tar.gz -
Subject digest:
c1907e6b45acbff27e7646445c82666e4af20ffacc4845d24b3c5f3f550737bd - Sigstore transparency entry: 234800552
- Sigstore integration time:
-
Permalink:
Jianxun/wave_view@80c19a632184227002b8dabd733a2addbfb2e3ec -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jianxun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@80c19a632184227002b8dabd733a2addbfb2e3ec -
Trigger Event:
release
-
Statement type:
File details
Details for the file wave_view-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wave_view-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f04777fef6252f9f906ad028186379f879a1e8a9fc78d630d299d97f3debdbd3
|
|
| MD5 |
6c3086c6c2edf8bfc42baf0e08358efe
|
|
| BLAKE2b-256 |
d648d8359003dd2e59820227bf070b61c98a27344c946ed8777341f66f1c30ee
|
Provenance
The following attestation bundles were made for wave_view-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Jianxun/wave_view
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wave_view-0.1.0-py3-none-any.whl -
Subject digest:
f04777fef6252f9f906ad028186379f879a1e8a9fc78d630d299d97f3debdbd3 - Sigstore transparency entry: 234800555
- Sigstore integration time:
-
Permalink:
Jianxun/wave_view@80c19a632184227002b8dabd733a2addbfb2e3ec -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jianxun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@80c19a632184227002b8dabd733a2addbfb2e3ec -
Trigger Event:
release
-
Statement type: