osmose.engine_cs.bridge

The only module that imports pythonnet (spec sections 9.1 and 9.4).

load() hosts CoreCLR once per process and returns the Osmose.Engine namespace module. Never call it in a process that later forks: CoreCLR’s runtime threads do not survive fork. The calibration and UQ pools use spawn/forkserver, so each worker loads its own.

Module Attributes

POLL_SECONDS

How often the waiting thread wakes to forward a cancel request and let signals through.

Functions

load()

Host the CLR (first call only) and return the Osmose.Engine namespace module.

run(bundle, control[, cancel_token])

Call OsmoseEngine.RunSimulation on bundle and return its summary as (status, steps, records, peak_schools, elapsed_seconds, rng_scheme, phase_seconds), the last a dict (movement, regroup, mortality, life_cycle, outputs).

Exceptions

CSharpEngineUnavailable

The engine cannot be loaded here; the message says why and how to fix it.