register_integrator#
- class braincell.quad.register_integrator(name, *, aliases=(), category='general', order=None, description='', deprecated=False, override=False)[source]#
Decorator: register the wrapped function in the global registry.
The decorated function is returned unchanged so it remains directly callable. Place this decorator outside any other decorators (such as
braincell._misc.set_module_as()) so that the registry stores thefinal exported function.
- Parameters:
name (
str) – Canonical name under which to register the integrator.aliases (
Iterable[str]) – Alternative lookup names. SeeIntegratorRegistry.register().category (
str) – Forwarded toIntegratorRegistry.register().order (
int|None) – Forwarded toIntegratorRegistry.register().description (
str) – Forwarded toIntegratorRegistry.register().deprecated (
bool) – Forwarded toIntegratorRegistry.register().override (
bool) – Forwarded toIntegratorRegistry.register().
- Return type:
Examples
>>> from braincell.quad import register_integrator >>> @register_integrator("euler", aliases=("explicit",), ... category="explicit", order=1) ... def euler_step(target, *args): ... ...