Closed ethho closed 4 years ago
Yes it's expected behavior. Currently Xarray objects are used only for the model I/O interface.
I agree that using xarray DataArray or Variable inside process classes would be useful, though. I suggest that in #141.
Thanks for confirming, @benbovy.
For posterity: I worked around this by writing upstream "converter" processes that ingest np.ndarray
or numbers.Number
and output DataArray
s.
Given the process definitions below:
We see expected behavior when instantiating an
xr.DataArray
within an upstream process:However, when the same variable is passed as an input, it is converted to a
numpy.ndarray
:Is this expected behavior? If so, what is best practice for passing
DataArray
s as model inputs?Environment