Commit 612acc8b authored by Martin Beseda's avatar Martin Beseda

FIX + ENH: Fixed evaluation of multiple calls of main region in one program...

FIX + ENH: Fixed evaluation of multiple calls of main region in one program start. Added check for missing iterations of some nested regions.
parent cfd80e29
......@@ -1579,12 +1579,14 @@ class DataContainer:
utils.print_err('Loading default values - check your CSV files with measured '
'data \n'
'corresponding to following settings. Data for {}. program start '
'(init_{}) '
'are probably missing.\n\n'
''
'Region: {}\n'
'Default func-value: {}'.format(prog_start_ind,
self.get_region_name(),
def_label[i]))
'Func-value: {}'.format(prog_start_ind+1,
prog_start_ind,
self.get_region_name(),
def_label[i]))
# TODO dopsat auto detekci souboru s chybejicimi daty
#if filename_args:
......@@ -2373,11 +2375,12 @@ class DataReader:
t = self.__get_y_label_vals(data_per_iterations,
evaluated_var['category'],
evaluated_var['arg'],
summate=False)
summate=True) # TODO summate byla zmena z False na True
try:
tmp[evaluated_var_ind] = t[0]
except IndexError:
#try:
tmp[evaluated_var_ind] = t # TODO bylo zmeneno z t[0] na t
if t['numOfNestedCalls'] == 0:
#except IndexError:
utils.print_err('Bad data category or argument - compare \'y_label\' variable in the '
'config file with your CSV files!\n'
'Category: {cat}\n'
......@@ -2624,7 +2627,25 @@ class Evaluator:
for i in range(num_of_vars)]
for func in func_lst]
tmp = [stat_optim(func)[ind_of_iter_ind] for nested_func_lst in all_nested_funcs for func in nested_func_lst]
#tmp = [stat_optim(func)[ind_of_iter_ind] for nested_func_lst in all_nested_funcs for func in nested_func_lst]
tmp = []
for nested_func_lst in all_nested_funcs:
for func in nested_func_lst:
try:
tmp.append(stat_optim(func)[ind_of_iter_ind])
except IndexError:
utils.print_err('There are no data for region {} in the {}. iteration!\n\n'
'Settings:\n'
'Configuration: {}\n'
'x-value: {}\n'
'func-label: {}\n'
'keys: {}\n'.format(func,
ind_of_iter_ind,
conf,
main_optim_x_val,
main_optim_func_label,
main_optim_keys))
tmp = [e for e in tmp if None not in e]
sum_stat_optims = [sum(e) if e else None for e in zip(*tmp)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment