For example, consider the spectroscopy context:
@context(n=1) spectroscopy = sp
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
spectroscopycontext:There the conversion depends on the variable
nused. Now, consider aDataArray/DataSetwherenis adimension/coordinate. Then when callingDataArray.pint.to("nm")we would want the variablento be dynamically imported from the current context of theDataArraycoordinate.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
pintsupport for more complicated context and decorators.