Metadata-Version: 2.4
Name: wavesimpro
Version: 1.9.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, STL, voxel arrays), sources
  (point, plane wave, Gaussian beam, custom field, engine-solved waveguide mode) and monitors.
- 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.
