gds_fdtd.caching

gds_fdtd simulation toolbox.

Simulation-result caching. A job is identified by a sha256 over a canonical JSON fingerprint of everything that determines its result: component geometry (structures, ports, bounds), technology, SimulationSpec, solver name and engine version. cached_run short-circuits repeat runs to a stored SMatrix — the expensive run() executes at most once per distinct job.

Results are stored as <solver>_<hash16>.npz via SMatrix.to_npz (npz rather than HDF5 so the cache has zero optional dependencies).

Functions

cache_path(solver, cache_dir)

cached_run(solver, cache_dir)

Return the cached SMatrix for this exact job, running only on a miss.

component_fingerprint(component)

Everything about the geometry that affects a simulation result.

job_fingerprint(solver)

The full canonical description of one simulation job.

job_hash(solver)

sha256 hex digest of the job fingerprint (the cache key).