diff --git a/pyerrors/input/sfcf.py b/pyerrors/input/sfcf.py index 13017369..f263fc24 100644 --- a/pyerrors/input/sfcf.py +++ b/pyerrors/input/sfcf.py @@ -610,7 +610,7 @@ def _check_append_rep(content, start_list): has_regular_len_heads = True for chunk_num in range(len(start_list)): start = start_list[chunk_num] - if chunk_num == len(start_list)-1: + if chunk_num == len(start_list) - 1: stop = len(content) else: stop = start_list[chunk_num+1] @@ -621,7 +621,7 @@ def _check_append_rep(content, start_list): break header_len_list.append(header_len) data_len_list.append(len(chunk) - header_len) - + if len(set(header_len_list)) > 1: warnings.warn("Not all headers have the same length. Data parts do.") has_regular_len_heads = False @@ -653,7 +653,6 @@ def _read_chunk_structure(chunk, pattern, b2b): return gauge_line, corr_line, start_read, T - def _read_append_rep(filename, pattern, b2b, im, single, idl_func, cfg_func_args): with open(filename, 'r') as fp: content = fp.readlines() @@ -674,10 +673,10 @@ def _read_append_rep(filename, pattern, b2b, im, single, idl_func, cfg_func_args for chunk_num in range(len(chunk_start_lines)): start = chunk_start_lines[chunk_num] - if chunk_num == len(chunk_start_lines)-1: + if chunk_num == len(chunk_start_lines) - 1: stop = len(content) else: - stop = chunk_start_lines[chunk_num+1] + stop = chunk_start_lines[chunk_num + 1] chunk = content[start:stop] if not has_regular_len_heads: gauge_line, corr_line, start_read, T = _read_chunk_structure(chunk, pattern, b2b)