From 0d2cde7e55d4ac6a8cafd2454f03cae77dd0d358 Mon Sep 17 00:00:00 2001
From: Tamino Huxohl <thuxohl@techfak.uni-bielefeld.de>
Date: Fri, 13 Jan 2023 11:09:11 +0100
Subject: [PATCH] fix copy method in patches dataset

---
 mu_map/dataset/patches.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mu_map/dataset/patches.py b/mu_map/dataset/patches.py
index 248a0a5..b4d0b1f 100644
--- a/mu_map/dataset/patches.py
+++ b/mu_map/dataset/patches.py
@@ -46,6 +46,8 @@ class MuMapPatchDataset(MuMapDataset):
         self.generate_patches()
 
     def copy(self, split_name: str):
+        kwargs = self.kwargs.copy()
+        kwargs["split_name"] = split_name
         return MuMapPatchDataset(
             dataset_dir=self.dir,
             patches_per_image=self.patches_per_image,
@@ -53,7 +55,7 @@ class MuMapPatchDataset(MuMapDataset):
             patch_size_z=self.patch_size_z,
             patch_offset=self.patch_offset,
             shuffle=self.shuffle,
-            **self.kwargs,
+            **kwargs,
         )
 
     def generate_patches(self):
-- 
GitLab