Browse code

handle empty data files when loading, closes #148 (#149)

Bas Nijholt authored on 30/01/2019 14:58:48 • GitHub committed on 30/01/2019 14:58:48
Showing 2 changed files
... ...
@@ -654,7 +654,8 @@ class Learner1D(BaseLearner):
654 654
         return self.data
655 655
 
656 656
     def _set_data(self, data):
657
-        self.tell_many(*zip(*data.items()))
657
+        if data:
658
+            self.tell_many(*zip(*data.items()))
658 659
 
659 660
 
660 661
 def _fix_deepcopy(sorted_dict, x_scale):
... ...
@@ -770,7 +770,8 @@ class LearnerND(BaseLearner):
770 770
         return self.data
771 771
 
772 772
     def _set_data(self, data):
773
-        self.tell_many(*zip(*data.items()))
773
+        if data:
774
+            self.tell_many(*zip(*data.items()))
774 775
 
775 776
     def _get_iso(self, level=0.0, which='surface'):
776 777
         if which == 'surface':