Closed marscher closed 1 year ago
The problem here is that parameters must be quantities when provided as xarray objects (we only assume "dimensionless" by default for simple numpy arrays)
This is certainly inconsistent and lacking in the documentation. We should at least provide an error message to catch that case before we run into asdf troubles as seen here
this works
import weldx
from weldx import Q_
import xarray as xr
x = xr.DataArray(Q_([1,2,3],""))
m = weldx.MathematicalExpression("x**2 + 4*x + 7", {"x": x})
weldx.WeldxFile(tree={"m": m}, mode="rw")
at least it should raise, or even better enforce the input to be a (dimensionless) quantity, right?
IMO this snippet should work
but raises: