From f8a87ff1069d7fab7031804da2d66773be8695a6 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Wed, 17 Aug 2011 14:40:25 -0400 Subject: documentation update and open hdf5 files in read only mode in draw.py --- draw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'draw.py') diff --git a/draw.py b/draw.py index 70efda7..30a2ffd 100755 --- a/draw.py +++ b/draw.py @@ -17,7 +17,7 @@ def roundrobin(*iterables): nexts = cycle(islice(nexts, pending)) def draw(filename, nevents): - f = h5py.File(filename) + f = h5py.File(filename, 'r') fig = plt.figure() for i, dataset in enumerate((f[name] for name in f)): @@ -37,6 +37,8 @@ def draw(filename, nevents): plt.ylabel('Voltage (V)') plt.title(dataset.name) + f.close() + return fig if __name__ == '__main__': -- cgit