Repository: KIT-IAI/pyWATTS

Issue:
Wrong input for keras wrapper
**Describe the bug**
Training a pipeline with a Keras model fails since commit `abe233e8635a891154f5dc144cdc9f100b9a713b`
**To Reproduce**
Steps to reproduce the behavior:
1. Start KerasExample
2. See error

**Expected behavior**
The Keras example executes without an error and perform the forecasts.

**Additional context**
The input of keras is a xr.Dataarray instead of numpy array

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 65f8588..a898629 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@
 ### Deprecated
 
 ### Fixed
+* Converts the input for the keras model in the kerasWrapper from xr.Dataarray to np.array ([#97](https://github.com/KIT-IAI/pyWATTS/issues/97))
 * Missing call of _get_rolling in Rolling Base  ([#76](https://github.com/KIT-IAI/pyWATTS/issues/76))
 * Fix save and load of keras Wrapper  ([#91](https://github.com/KIT-IAI/pyWATTS/issues/91))
 * Import of pytorchWrapper via wrapper.__init__
diff --git a/pywatts/wrapper/keras_wrapper.py b/pywatts/wrapper/keras_wrapper.py
index 266c985..76daa11 100644
--- a/pywatts/wrapper/keras_wrapper.py
+++ b/pywatts/wrapper/keras_wrapper.py
@@ -43,7 +43,8 @@ class KerasWrapper(DlWrapper):
         :param y: The target data
         """
         x, y = split_kwargs(kwargs)
-
+        x = {name_x: value_x.values for name_x, value_x in x.items()}
+        y = {name_y: value_y.values for name_y, value_y in y.items()}
         self.targets = list(y.keys())
 
         if not self.compiled:


Test patch:
diff --git a/tests/unit/wrapper/test_keras_wrapper.py b/tests/unit/wrapper/test_keras_wrapper.py
index 282c305..9f618f2 100644
--- a/tests/unit/wrapper/test_keras_wrapper.py
+++ b/tests/unit/wrapper/test_keras_wrapper.py
@@ -66,6 +66,9 @@ class TestKerasWrapper(unittest.TestCase):
         self.keras_mock.fit.assert_called_once()
         args = self.keras_mock.fit.call_args
 
+        self.assertEqual(type(args[1]["x"]["data"]), np.ndarray)
+        self.assertEqual(type(args[1]["y"]["target"]), np.ndarray)
+
         np.testing.assert_equal(args[1]["x"]["data"],
                                 np.array([[2, 0], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7]]))
         np.testing.assert_equal(args[1]["y"]["target"],