Metadata-Version: 2.4
Name: wavesimpro
Version: 1.10.0
Summary: WavesimPro Python API — cloud execution client for the Rayfos simulation platform
Author: Rayfos
Project-URL: Repository, https://github.com/rayfos/wavesimpro
Keywords: wavesim,simulation,electromagnetic,rayfos,api
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.20.0
Requires-Dist: requests>=2.28.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: tqdm>=4.60.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"

# wavesimpro

Python client for the Rayfos Wavesim cloud: build a simulation setup, run it on a Rayfos
compute node, and read the results back as NumPy arrays.

Wavesim is a single-wavelength frequency-domain solver (vectorial Maxwell when a polarized
source is present, scalar Helmholtz otherwise). This package talks to the Rayfos JobServer
REST API; it does not contain the solver.

## Install

```bash
pip install wavesimpro
python -m wavesimpro setup      # one-time: API key + server URL wizard
```

The wizard stores the credentials; `wavesimpro.configure(api_key=..., api_url=...)` sets
them for one process instead.

## Quick start

```python
import wavesimpro as wp

props = wp.create_wavesim_properties(
    wavelength=1.0, pixel_size=0.1, boundary_width=5.0,
    domain=wp.create_simulation_domain(20, 20, 20),
    mediums=[wp.create_medium("Silicon", 3.48, 0.0)],
    primitives=[wp.create_box_primitive("core", 0, 0, 0, 10, 0.5, 20, medium="Silicon")],
    sources=[wp.create_mode_source("in", 0, 0, -8.0, polarization="X")],
    monitors=[wp.create_monitor("out", 0, 0, 8.0, 10, 10, 0)],
)
run = wp.simulate(props, name="strip waveguide")
field = wp.read_binary_field(run.download("output.bin"))
```

## What the API covers

- Setup helpers for domains, media, primitives (box, sphere, ellipsoid, cylinder, cone,
  N-sided prism, STL, GDSII layouts, voxel arrays), sources (point, plane wave, Gaussian beam,
  custom field, custom-from-file, engine-solved waveguide mode) and monitors:
  `create_box_primitive`, `create_sphere_primitive`, `create_ellipsoid_primitive`,
  `create_cylinder_primitive`, `create_cone_primitive`, `create_prism_primitive`,
  `create_stl_primitive`, `create_gds_primitive` (with `create_gds_layer_config` /
  `create_gds_structure_override`), `create_voxels_model_primitive`.
- Per-primitive sub-pixel flag (`subpixel=True/False` on every shape, STL and GDSII helper)
  to choose which shapes get smoothed interfaces.
- Per-axis pixel sizes (`pixel_size=[dx, dy, dz]`) and sub-pixel permittivity averaging
  (`subpixel_factor=`), when the compute node supports them.
- Preflight memory check and cost estimate before a run.
- Binary upload/download helpers for permittivity volumes, source fields and monitors.

See `CHANGELOG.md` for what each version added. Issues and feature requests: support@rayfos.com.
