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
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
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")],
# TE0 solved by the engine on the z = -6 um voxel layer (index 40 of 200), launched along +z
sources=[wp.create_mode_source("in", 0, 0, -6.0, axis="z", plane_index=40, polarization="TE")],
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(withcreate_gds_layer_config/create_gds_structure_override),create_voxels_model_primitive. - Per-primitive sub-pixel flag (
subpixel=True/Falseon every shape, STL and GDSII helper) to choose which shapes get smoothed interfaces. Off by default: a setup with no averaged shape is voxelised exactly as before 1.10 and runs on every compute node. - 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.
Monitors: which voxels you get
A monitor is an axis-aligned box in micrometres, relative to the coordinate-system centre. The domain of N voxels spans [-S/2, S/2], so voxel i occupies [-S/2 + i·v, -S/2 + (i+1)·v] with v = S/N (centre at -S/2 + (i+0.5)·v, for even and odd N alike). The compute node extracts the outer cover of the box: every voxel it touches — first index floor(lo), last index ceil(hi) − 1 with lo/hi the box edges in voxel units. An edge exactly on a voxel face does not pull in the neighbour; a zero-thickness box is the one voxel containing the plane. So a box of exactly k voxels aligned to the grid gives k planes, and the same box centred on a voxel centre straddles k + 1; the result is never smaller than what you asked for unless the domain clamps it.
The node writes monitors.json next to the monitor_<name>.bin files with, per monitor, the
inclusive index ranges, the shape, the voxel size and the realised physical box; read it with
run.monitor_regions(). Monitor files are full resolution — nothing is downsampled on download.
Cost before upload
client.preflight_check(..., max_iterations=n) (called for you by simulate*, submit and
execute_via_api) returns a cost block on the cloud server: the upper-bound compute-token
cost at the run's iteration cap (voxels × iterations × field components × rate), your remaining
balance and whether the submit would be allowed. The run is charged for the iterations it
actually takes. The high-level calls stop before uploading anything when the cost is refused.
client.get_quota() returns the balance; client.estimate_cost(project_id, version_id) prices a
saved version.
Errors and warnings
Every RayfosAPIError message carries the server's full detail: the message, each
errors[]/warnings[] entry and, for a quota refusal, the estimated cost and remaining balance.
Pass sampling_warnings=False (or configure(sampling_warnings=False)) to silence the
"pixels per wavelength" advisory when your sampling is deliberate; Nyquist warnings stay.
run.status()["commandStatus"]["engine"] names the engine the node actually ran ("Cpp" or
"Python"), also for engine="Any".
See CHANGELOG.md for what each version added. Issues and feature requests: support@rayfos.com.
Metadata
Release files for wavesimpro 1.17.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wavesimpro-1.17.2.tar.gz | 98.1 kB | Without provenance | Details for wavesimpro-1.17.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wavesimpro-1.17.2-py3-none-any.whl | Python 3 | none | any | Details for wavesimpro-1.17.2-py3-none-any.whl |
Total release size: 194.4 kB
Release files / wavesimpro-1.17.2.tar.gz
| Download URL | wavesimpro-1.17.2.tar.gz |
|---|---|
| Size | 98.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71c07339a4a009fe7ca6d077501c6ecb98eade332ead34c3d79b9d8a82410e09
|
|
BLAKE2b-256 checksum How to use checksums |
f128260bfd466ee3faa5035920e3cb9b069869f4b9651326d0b19b595c409b59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RayfosJobServer-PypiPublish/1.0
|
Release files / wavesimpro-1.17.2-py3-none-any.whl
| Download URL | wavesimpro-1.17.2-py3-none-any.whl |
|---|---|
| Size | 96.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40d4661dbe6264a3a1e37d725b32c1eef4b5f4041b6ec17d49a3b382e8b8bec6
|
|
BLAKE2b-256 checksum How to use checksums |
f2625c56fd5ff69980303ab6ebacde371a0ebe493bf43daca85723aa693cb0f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RayfosJobServer-PypiPublish/1.0
|
Security for wavesimpro 1.17.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.