@@ -646,7 +646,8 @@ def setRawInput(self, path_list, set_name, type='file-name', id='raw-text', over
646
646
if id not in self .ids_inputs or overwrite_split :
647
647
self .ids_inputs .append (id )
648
648
self .types_inputs .append (type )
649
- self .optional_inputs .append (id ) # This is always optional
649
+ if id not in self .optional_inputs :
650
+ self .optional_inputs .append (id ) # This is always optional
650
651
elif id in keys_X_set and not overwrite_split :
651
652
raise Exception ('An input with id "' + id + '" is already loaded into the Database.' )
652
653
@@ -723,7 +724,7 @@ def setInput(self, path_list, set_name, type='raw-image', id='image', repeat_set
723
724
elif id in keys_X_set and not overwrite_split :
724
725
raise Exception ('An input with id "' + id + '" is already loaded into the Database.' )
725
726
726
- if not required :
727
+ if not required and id not in self . optional_inputs :
727
728
self .optional_inputs .append (id )
728
729
729
730
if type not in self .__accepted_types_inputs :
@@ -819,7 +820,8 @@ def setRawOutput(self, path_list, set_name, type='file-name', id='raw-text', ove
819
820
if id not in self .ids_inputs or overwrite_split :
820
821
self .ids_inputs .append (id )
821
822
self .types_inputs .append (type )
822
- self .optional_inputs .append (id ) # This is always optional
823
+ if id not in self .optional_inputs :
824
+ self .optional_inputs .append (id ) # This is always optional
823
825
824
826
elif id in keys_Y_set and not overwrite_split :
825
827
raise Exception ('An input with id "' + id + '" is already loaded into the Database.' )
@@ -3377,17 +3379,18 @@ def __checkLengthSet(self, set_name):
3377
3379
"""
3378
3380
if eval ('self.loaded_' + set_name + '[0] and self.loaded_' + set_name + '[1]' ):
3379
3381
lengths = []
3382
+ plot_ids_in = []
3380
3383
for id_in in self .ids_inputs :
3381
3384
if id_in not in self .optional_inputs :
3382
- exec ('lengths.append(len(self.X_' + set_name + '[id_in]))' )
3385
+ plot_ids_in .append (id_in )
3386
+ exec ('lengths.append(len(self.X_' + set_name + '[id_in]))' )
3383
3387
for id_out in self .ids_outputs :
3384
3388
exec ('lengths.append(len(self.Y_' + set_name + '[id_out]))' )
3385
3389
if lengths [1 :] != lengths [:- 1 ]:
3386
3390
raise Exception ('Inputs and outputs size '
3387
3391
'(' + str (lengths ) + ') for "' + set_name + '" set do not match.\n '
3388
- '\t Inputs:' + str (self .ids_inputs ) + ''
3389
- '\t Outputs:' + str (
3390
- self .ids_outputs ))
3392
+ '\t Inputs:' + str (plot_ids_in ) + ''
3393
+ '\t Outputs:' + str (self .ids_outputs ))
3391
3394
3392
3395
def __getNextSamples (self , k , set_name ):
3393
3396
"""
0 commit comments