ODELoopConfig

class cubie.integrators.loops.ode_loop_config.ODELoopConfig(precision: type[float16] | type[float32] | type[float64] | dtype[float16] | dtype[float32] | dtype[float64], n_states: int = 0, n_parameters: int = 0, n_drivers: int = 0, n_observables: int = 0, n_error: int = 0, n_counters: int = 0, state_summaries_buffer_height: int = 0, observable_summaries_buffer_height: int = 0, state_location: str = 'local', proposed_state_location: str = 'local', parameters_location: str = 'local', drivers_location: str = 'local', proposed_drivers_location: str = 'local', observables_location: str = 'local', proposed_observables_location: str = 'local', error_location: str = 'local', counters_location: str = 'local', state_summary_location: str = 'local', observable_summary_location: str = 'local', dt_location: str = 'local', accept_step_location: str = 'local', proposed_counters_location: str = 'local', compile_flags: OutputCompileFlags = NOTHING, save_every: float | None = None, summarise_every: float | None = None, sample_summaries_every: float | None = None, save_last: bool = False, save_regularly: bool = False, summarise_regularly: bool = False, save_state_fn: Callable | None = None, update_summaries_fn: Callable | None = None, save_summaries_fn: Callable | None = None, step_controller_fn: Callable | None = None, step_function: Callable | None = None, evaluate_driver_at_t: Callable | None = None, evaluate_observables: Callable | None = None, dt0: float | None = 0.01, is_adaptive: bool | None = False)[source]

Bases: CUDAFactoryConfig

Compile-critical settings for an integrator loop.

n_states

Number of state variables.

Type:

int

n_parameters

Number of parameters.

Type:

int

n_drivers

Number of driver variables.

Type:

int

n_observables

Number of observable variables.

Type:

int

n_error

Number of error elements (typically equals n_states for adaptive).

Type:

int

n_counters

Number of counter elements.

Type:

int

state_summaries_buffer_height

Height of state summary buffer.

Type:

int

observable_summaries_buffer_height

Height of observable summary buffer.

Type:

int

precision

Precision used for all loop-managed computations.

Type:

type[numpy.float16] | type[numpy.float32] | type[numpy.float64] | numpy.dtype[numpy.float16] | numpy.dtype[numpy.float32] | numpy.dtype[numpy.float64]

compile_flags

Output configuration governing save and summary cadence.

Type:

cubie.outputhandling.output_config.OutputCompileFlags

_save_every

Interval between accepted saves.

Type:

float | None

_summarise_every

Interval between summary accumulations.

Type:

float | None

_sample_summaries_every

Interval between summary metric updates.

Type:

float | None

save_state_fn

Device function that records state and observable snapshots.

Type:

Callable | None

update_summaries_fn

Device function that accumulates summary statistics.

Type:

Callable | None

save_summaries_fn

Device function that writes summary statistics to output buffers.

Type:

Callable | None

step_controller_fn

Device function that updates the timestep and acceptance flag.

Type:

Callable | None

step_function

Device function that advances the solution by one tentative step.

Type:

Callable | None

evaluate_driver_at_t

Device function that evaluates driver signals for a given time.

Type:

Callable | None

evaluate_observables

Device function that evaluates observables for the current state.

Type:

Callable | None

_dt0

Initial timestep prior to controller feedback.

Type:

float | None

is_adaptive

Whether the loop operates with an adaptive controller.

Type:

bool | None

accept_step_location: str
compile_flags: OutputCompileFlags
counters_location: str
drivers_location: str
property dt0: float

Return the initial timestep.

dt_location: str
error_location: str
evaluate_driver_at_t: Callable | None
evaluate_observables: Callable | None
is_adaptive: bool | None
n_counters: int
n_drivers: int
n_error: int
n_observables: int
n_parameters: int
n_states: int
observable_summaries_buffer_height: int
observable_summary_location: str
observables_location: str
parameters_location: str
proposed_counters_location: str
proposed_drivers_location: str
proposed_observables_location: str
proposed_state_location: str
property sample_summaries_every: float | None

Return the summary sampling interval, or None if not configured.

property samples_per_summary

If summarise_every and sample_summaries_every are both set, calculate samples_per_summary and warn/raise if it’s not a clean integer.

property save_every: float | None

Return the output save interval, or None if not configured.

save_last: bool
save_regularly: bool
save_state_fn: Callable | None
save_summaries_fn: Callable | None
state_location: str
state_summaries_buffer_height: int
state_summary_location: str
step_controller_fn: Callable | None
step_function: Callable | None
property summarise_every: float | None

Return the summary interval, or None if not configured.

summarise_regularly: bool
update_summaries_fn: Callable | None