diff --git a/lattice.py b/lattice.py index 2395dd7..aa4bc04 100644 --- a/lattice.py +++ b/lattice.py @@ -235,8 +235,6 @@ def lattice(filepath, f=None, s=15, jtol=2, mtol=2, invert=False, debug=None): plt.plot([v[0], v[2]], [v[1], v[3]]) for h in h_s: plt.plot([h[0], h[2]], [h[1], h[3]]) - plt.show() - return None columns, rows = zip(*tables_new[k]) columns, rows = list(columns), list(rows) @@ -273,8 +271,6 @@ def lattice(filepath, f=None, s=15, jtol=2, mtol=2, invert=False, debug=None): if table.cells[i][j].bottom: plt.plot([table.cells[i][j].lb[0], table.cells[i][j].rb[0]], [table.cells[i][j].lb[1], table.cells[i][j].rb[1]]) - plt.show() - return None # fill text after sorting it if not rotated: @@ -309,4 +305,8 @@ def lattice(filepath, f=None, s=15, jtol=2, mtol=2, invert=False, debug=None): output['table_%d' % num_tables] = data num_tables += 1 + if debug in ['line', 'table']: + plt.show() + return None + return output \ No newline at end of file diff --git a/stream.py b/stream.py index 13cb8d8..e09d9ed 100644 --- a/stream.py +++ b/stream.py @@ -114,6 +114,7 @@ def stream(filepath, ncolumns=0, columns=None, char_margin=2.0, return None if columns: + columns = columns.split(',') cols = [(float(columns[i]), float(columns[i + 1])) for i in range(0, len(columns) - 1)] cols = [(c[0] + c[1]) / 2.0 for c in cols]