Repository: KIT-IAI/pyWATTS

Issue:
Merger does not work (merges in the wrong direction)

Discussion:

Patch:
diff --git a/pywatts/modules/postprocessing/merger.py b/pywatts/modules/postprocessing/merger.py
index 5260efd..10754ba 100644
--- a/pywatts/modules/postprocessing/merger.py
+++ b/pywatts/modules/postprocessing/merger.py
@@ -84,7 +84,7 @@ class Merger(BaseTransformer):
         r = []
         for i in range(horizon):
             r.append(np.concatenate(
-                [np.full(fill_value=np.nan, shape=(horizon - 1 - i)),
+                [np.full(fill_value=np.nan, shape=(i)),
                  x.values[:, i],
-                 np.full(fill_value=np.nan, shape=(i,))]))
+                 np.full(fill_value=np.nan, shape=(horizon - 1 - i,))]))
         return np.stack(r)


Test patch:
diff --git a/tests/unit/modules/test_merger.py b/tests/unit/modules/test_merger.py
index d224558..032ddb1 100644
--- a/tests/unit/modules/test_merger.py
+++ b/tests/unit/modules/test_merger.py
@@ -40,7 +40,7 @@ class TestMerger(unittest.TestCase):
         self.merger.set_params(method="mean")
         result = self.merger.transform(da)
 
-        expected_result = xr.DataArray([np.nan, np.nan, 4 / 3, 2, 3, 4, 5],
+        expected_result = xr.DataArray([np.nan, np.nan, 1, 2, 3, 4, 5],
                                        dims=["time"], coords={"time": time})
         xr.testing.assert_equal(result, expected_result)