Commit c8b0feff authored by Ivo Peterek's avatar Ivo Peterek

ENH: edit error message for non-numerical y_label values in csv files.

parent 0ef646d6
......@@ -1917,7 +1917,7 @@ class DataReader:
# Fce pro ziskani hodnot z CSV,
# ktere slouzi jako yLabelArg.
@staticmethod
def __get_y_label_vals(values_lst, y_label_cat, y_label_arg, summate=True):
def __get_y_label_vals(values_lst, y_label_cat, y_label_arg, dirpath, filename, summate=True):
ret_lst = list()
try:
for dic in values_lst:
......@@ -1925,7 +1925,12 @@ class DataReader:
if key == y_label_cat:
for tup in lst:
if tup[0] == y_label_arg:
ret_lst.append(float(tup[1]))
try:
ret_lst.append(float(tup[1]))
except ValueError:
utils.print_err('Bad value {val} of y_label "{lab}" in the file {file} in the'
' region {reg}! Is "{lab}" the correct y_label?'
.format(val=tup[1], file=filename, reg=dirpath, lab=y_label_arg))
except KeyError:
utils.print_err('y-label category not found - check your settings and contents of your CSV files!')
......@@ -2316,7 +2321,9 @@ class DataReader:
for evaluated_var in self.__evaluated_vars:
tmp2.append(self.__get_y_label_vals(tmp,
evaluated_var['category'],
evaluated_var['arg']))
evaluated_var['arg'],
dirpath,
filename))
# Kontrola, kdyz vnorena funkce neni nikdy volana
# v regionu danem parametrem 'iter_call_reg'
......@@ -2336,6 +2343,8 @@ class DataReader:
t = self.__get_y_label_vals(data_per_iterations,
evaluated_var['category'],
evaluated_var['arg'],
dirpath,
filename,
summate=False)
try:
......
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