gds_fdtd is a minimal Python module to assist in setting up FDTD simulations for planar nanophotonic devices using FDTD solvers such as Tidy3D.
- Automated FDTD Setup: Easily set up Lumerical and Tidy3D simulations for devices designed in GDS.
 - Integration with SiEPIC: Generate FDTD simulations directly from components defined in SiEPIC EDA and it's associated PDKs (e.g., SiEPIC-EBeam-PDK).
 - Integration with gdsfactory: Generate Tidy3D simulations directly from gdsfactory designs by identifying ports and simulation regions from an input technology stack.
 - S-Parameter Extraction: Automatically generate and export S-parameters of your photonic devices in standard formats.
 - Multimode/Dual Polarization Simulations: Set up simulations that support multimode or dual polarization configurations for device analysis.
 
You can install gds_fdtd using the following options:
pip install gds-fdtdTo install the core functionality of gds_fdtd, clone the repository and install using pip:
git clone [email protected]:mustafacc/gds_fdtd.git
cd gds_fdtd
pip install -e .For contributing to the development or if you need testing utilities, install with the dev dependencies:
git clone [email protected]:mustafacc/gds_fdtd.git
cd gds_fdtd
pip install -e .[dev]This will install additional tools like pytest and coverage for testing.
pip install -e .[dev]| extra | purpose | install command | 
|---|---|---|
| siepic | SiEPIC EDA support | pip install -e .[siepic] | 
| tidy3d | Tidy3D simulation support | pip install -e .[tidy3d] | 
| gdsfactory | GDSFactory EDA support | pip install -e .[gdsfactory] | 
| prefab | PreFab lithography prediction support | pip install -e .[prefab] | 
| everything | dev tools + all plugins | pip install -e .[dev,tidy3d,gdsfactory,prefab,siepic] | 
- Python ≥ 3.10 (note: gdsfactory requires Python ≥ 3.11)
 - Runtime deps: numpy, matplotlib, shapely, PyYAML, klayout
 
If you've installed the dev dependencies, you can run the test suite with:
pytest --cov=gds_fdtd tests
## Development
### Version Management
This project uses `bump2version` to keep version numbers in sync across all files.
**Check current version:**
```bash
make check-versionBump version:
# For bug fixes (0.4.0 -> 0.4.1)
make bump-patch
# For new features (0.4.0 -> 0.5.0)  
make bump-minor
# For breaking changes (0.4.0 -> 1.0.0)
make bump-majorQuick release:
# Does everything in one go
./scripts/release.sh [patch|minor|major]This script will:
- Run tests and build docs
 - Update version numbers everywhere
 - Create a git tag
 - Push everything to GitHub
 - Trigger GitHub release and PyPI upload
 
make help          # Show all available commands
make install       # Install package in development mode
make test          # Run tests with coverage
make docs          # Build documentation
make docs-serve    # Build and serve docs locally on port 8000
make clean         # Clean build artifacts
make release       # Build package for releaseFor new contributors:
# Clone the repository
git clone https://github.com/SiEPIC/gds_fdtd.git
cd gds_fdtd
# Install development dependencies
pip install -e .[dev]
# Run tests
make test
# Build documentation
make docs- Make sure you're on the main branch with all changes committed
 - Run the release script: 
./scripts/release.sh [patch|minor|major] - The script will automatically:
- Run tests to make sure everything works
 - Build documentation
 - Bump version numbers in all files
 - Create and push a git tag
 - Trigger GitHub Actions to create a release and upload to PyPI
 
 
The GitHub Actions workflow will:
- Run tests again
 - Build the package
 - Create a GitHub release with changelog
 - Upload to PyPI automatically
 
