comparison globalneighbors/read.py @ 5:7e27e874655b

test a larger grid + move distance insertion to its own function
author Jeff Hammel <k0scist@gmail.com>
date Sat, 24 Jun 2017 15:16:10 -0700
parents 1b94f3bf97e5
children
comparison
equal deleted inserted replaced
4:8e130b7bfed9 5:7e27e874655b
35 35
36 for index, row in enumerate(read_tsv_generator(f)): 36 for index, row in enumerate(read_tsv_generator(f)):
37 try: 37 try:
38 cast = cast_row(row, types=types) 38 cast = cast_row(row, types=types)
39 except AssertionError: 39 except AssertionError:
40 sys.stderr.write("Error, row {}".format(index)) 40 sys.stderr.write("Error, row {}\n{}\n".format(index, row))
41 raise 41 raise
42 if fields: 42 if fields:
43 cast = {key: value for key, value in cast.items() 43 cast = {key: value for key, value in cast.items()
44 if key in fields} 44 if key in fields}
45 yield cast 45 yield cast