wrap_function_change_dimensions function
(Shortest import: from brian2.units.fundamentalunits import wrap_function_change_dimensions)
- brian2.units.fundamentalunits.wrap_function_change_dimensions(func, change_dim_func)[source]
Returns a new function that wraps the given function
func
so that it changes the dimensions of its input. Quantities are transformed to unitless numpy arrays before callingfunc
, the output is a quantity with the original dimensions passed through the functionchange_dim_func
. A typical use would be asqrt
function that useslambda d: d ** 0.5
aschange_dim_func
.These transformations apply only to the very first argument, all other arguments are ignored/untouched.