braincell.quad.get_integrator#
- braincell.quad.get_integrator(method)[source]#
Resolve a numerical integrator from a string name or a callable.
- Parameters:
method (
str|Callable) – Either the registered name (canonical or alias) of an integrator or a step function to use directly.- Returns:
The integrator step function corresponding to
method.- Return type:
- Raises:
ValueError – If
methodis a string that does not match any registered integrator. The error message includes a “did you mean …?” suggestion when a close match exists.TypeError – If
methodis neither a string nor a callable.
Examples
>>> from braincell.quad import get_integrator >>> get_integrator('euler') <function euler_step at ...> >>> get_integrator('explicit') is get_integrator('euler') True >>> get_integrator('stagger') is get_integrator('staggered') True