wrap_function_keep_dimensions function¶
(Shortest import: from brian2.units.fundamentalunits import wrap_function_keep_dimensions)
- brian2.units.fundamentalunits.wrap_function_keep_dimensions(func)[source]¶
Returns a new function that wraps the given function
funcso that it keeps the dimensions of its input. Quantities are transformed to unitless numpy arrays before callingfunc, the output is a quantity with the original dimensions re-attached.These transformations apply only to the very first argument, all other arguments are ignored/untouched, allowing to work functions like
sumto work as expected with additionalaxisetc. arguments.