There the conversion depends on the variable n used. Now, consider a DataArray/DataSet where n is a dimension/coordinate. Then when calling DataArray.pint.to("nm") we would want the variable n to be dynamically imported from the current context of the DataArray coordinate.
API-wise I am not sure how that would work, maybe by passing a list/dict of context objects (+ variables)? This might also involve upstream pint support for more complicated context and decorators.
For example, consider the
spectroscopy
context:There the conversion depends on the variable
n
used. Now, consider aDataArray
/DataSet
wheren
is adimension
/coordinate
. Then when callingDataArray.pint.to("nm")
we would want the variablen
to be dynamically imported from the current context of theDataArray
coordinate.API-wise I am not sure how that would work, maybe by passing a list/dict of context objects (+ variables)? This might also involve upstream
pint
support for more complicated context and decorators.