Utilities¶
- class stix.sampling.utils.Direction(*values)¶
Bases:
EnumIntegration direction for the ODE/SDE solver.
- FORWARD = 'forward'¶
- REVERSE = 'reverse'¶
- stix.sampling.utils.check_scale_is_non_negative(scale_fn)¶
Check that
scale_fnis non-negative on the interior of[0, 1].Evaluated on a 1000-point grid excluding the endpoints, so a
Trueresult is necessary but not sufficient.Truealso comes back when the values are not concrete, which is the case for a callable closing over a traced value;ctmc_euler_step()clamps those at run time.
- stix.sampling.utils.validate_generator_types(modality_registry, *, supported, stochasticity_scale=None)¶
Validate each modality’s
generator_typeagainst a solver before tracing.- Parameters:
- Raises:
TypeError – If a modality declares a
generator_typethe solver cannot step (i.e. absent fromsupported).ValueError – If
stochasticity_scaleis set for a modality whose generator carries no score (Velocity), or if one of its callables is negative on[0, 1].
- Return type:
None