Repository: BAMWelDX/weldx

Issue:
Serializing MathematicalExpression with not quantified xarray.DataArray fails
IMO this snippet should work

``` python

import weldx
import xarray as xr

x = xr.DataArray([1,2,3])
m = weldx.MathematicalExpression("x**2 + 4*x + 7", {"x": x})
weldx.WeldxFile(tree={"m": m}, mode="rw")
```

but raises:
``` python 
  File "/home/marscher/sources/weldx/weldx/asdf/types.py", line 36, in to_yaml_tree_wrapped
    tree = func(self, obj, tag, ctx)
  File "/home/marscher/sources/weldx/weldx/tags/core/mathematical_expression.py", line 29, in to_yaml_tree
    setattr(v, META_ATTR, dict(dims=dims))
AttributeError: 'numpy.ndarray' object has no attribute 'wx_metadata'
```


Discussion:
github-actions[bot]: ## Test Results
2 189 tests  +2   2 188 [:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "passed tests") +2   3m 47s [:stopwatch:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "duration of all tests") + 1m 9s
       1 suites ±0          1 [:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "skipped / disabled tests") ±0 
       1 files   ±0          0 [:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "failed tests") ±0 

Results for commit 0f7d0964. ± Comparison against base commit 91140eb0.

[test-results]:data:application/gzip;base64,H4sIABN4LWQC/12MQQ6DIBAAv2I497AiKvQzjQU22VSlQTiZ/r0oVkmPM5PMypBGu7B7Vd8qtkQKJ5joh0BuTsh5n0RKYYu8luqHjyVqnZ283IvexyQLHGhMAk5hvXf+MD7OxXWjv2lW13PnYrlzedRumigkYIC9AdUJsGi0lEK0DRgLUgMKbBU3T41ou4Z9vsmIUWgJAQAA

codecov[bot]: ## [Codecov](https://codecov.io/gh/BAMWelDX/weldx/pull/864?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BAMWelDX) Report
> Merging [#864](https://codecov.io/gh/BAMWelDX/weldx/pull/864?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BAMWelDX) (0f7d096) into [master](https://codecov.io/gh/BAMWelDX/weldx/commit/91140eb0ad7193e317aa5998f535dbcc417e94bd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BAMWelDX) (91140eb) will **increase** coverage by `0.01%`.
> The diff coverage is `100.00%`.

```diff
@@            Coverage Diff             @@
##           master     #864      +/-   ##
==========================================
+ Coverage   96.47%   96.49%   +0.01%     
==========================================
  Files          95       95              
  Lines        6238     6242       +4     
==========================================
+ Hits         6018     6023       +5     
+ Misses        220      219       -1     
```


| [Impacted Files](https://codecov.io/gh/BAMWelDX/weldx/pull/864?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BAMWelDX) | Coverage Δ | |
|---|---|---|
| [weldx/core/math\_expression.py](https://codecov.io/gh/BAMWelDX/weldx/pull/864?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BAMWelDX#diff-d2VsZHgvY29yZS9tYXRoX2V4cHJlc3Npb24ucHk=) | `98.59% <100.00%> (+0.08%)` | :arrow_up: |

... and [1 file with indirect coverage changes](https://codecov.io/gh/BAMWelDX/weldx/pull/864/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BAMWelDX)

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BAMWelDX). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BAMWelDX)


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4f84e0c..5d227fa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,9 +2,13 @@
 
 ## 0.6.5 (unreleased)
 
+### Fixes
+
+- fix non quantified xarray parameter inputs to `MathematicalExpression` \[{pull}`864`\].
+
 ### Dependencies
 
-- require XArray >= 2022.9.0, as `LocalCoordinateSystem` now handles merges correctly \[{pull}`861`\].
+- require `xarray >= 2022.9.0`, as `LocalCoordinateSystem` now handles merges correctly \[{pull}`861`\].
 
 ## 0.6.4 (09.02.2023)
 
diff --git a/pyproject.toml b/pyproject.toml
index dbaaca9..4371595 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,7 +42,7 @@ dependencies = [
     "scipy >=1.4,!=1.6.0,!=1.6.1",
     "sympy >=1.6",
     "pint >=0.18",
-    "pint-xarray >=0.2.1",
+    "pint-xarray >=0.3",
     "bottleneck >=1.3.3",
     "boltons",
     "bidict",
diff --git a/weldx/core/math_expression.py b/weldx/core/math_expression.py
index f1a8c9e..bc83cfe 100644
--- a/weldx/core/math_expression.py
+++ b/weldx/core/math_expression.py
@@ -86,6 +86,8 @@ class MathematicalExpression:
         """
         return self.equals(other, check_parameters=True, check_structural_equality=True)
 
+    __hash__ = None
+
     def equals(
         self,
         other: Any,
@@ -169,6 +171,10 @@ class MathematicalExpression:
                 v = xr.DataArray(v[0], dims=v[1])
             if not isinstance(v, xr.DataArray):
                 v = Q_(v)
+            else:  # quantify as dimensionless if no unit provided
+                if v.weldx.units is None:
+                    v = v.pint.quantify("")
+                v = v.pint.quantify()
             self._parameters[k] = v
 
     @property


Test patch:
diff --git a/weldx/tests/asdf_tests/test_asdf_core.py b/weldx/tests/asdf_tests/test_asdf_core.py
index a51ba62..2e1cf08 100644
--- a/weldx/tests/asdf_tests/test_asdf_core.py
+++ b/weldx/tests/asdf_tests/test_asdf_core.py
@@ -141,7 +141,6 @@ def get_xarray_example_dataset():
     -------
         Dataset for test purposes
     """
-
     temp_data = [
         [[15.0, 16.0, 17.0], [18.0, 19.0, 20.0]],
         [[21.0, 22.0, 23.0], [24.0, 25.0, 26.0]],
@@ -847,10 +846,15 @@ class TestMathematicalExpression:
     @pytest.mark.parametrize(
         "a, b",
         [
+            ([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]),
             (Q_([1, 2, 3], "m"), Q_([4, 5, 6], "m")),
             (
                 xr.DataArray(Q_([1, 2], "m"), dims=["a"]),
-                xr.DataArray(Q_([3, 4], "m"), dims=["b"]),
+                xr.DataArray(Q_([3, 4], "m"), dims=["b"]).pint.dequantify(),
+            ),
+            (
+                xr.DataArray([1, 2], dims=["a"]),
+                xr.DataArray([3, 4], dims=["b"]),
             ),
             (
                 Q_([1, 2], "m"),