diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-12 15:12:22 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-12 15:12:22 -0400 |
commit | 7eb34b5312974f601d1117eeaf6393b9648be31c (patch) | |
tree | 838df63d06886bd3bbec560add8a1ac4ef4dd069 /parse/dir_map.py | |
parent | 09bc409657606a37346d82ab1e4c44a165bd3541 (diff) |
Improved error handling in parse_ and plot_exps.py.
Diffstat (limited to 'parse/dir_map.py')
-rw-r--r-- | parse/dir_map.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/parse/dir_map.py b/parse/dir_map.py index a8d2a83..231d21a 100644 --- a/parse/dir_map.py +++ b/parse/dir_map.py | |||
@@ -96,7 +96,10 @@ class DirMap(object): | |||
96 | return | 96 | return |
97 | 97 | ||
98 | with open(path, 'rb') as f: | 98 | with open(path, 'rb') as f: |
99 | data = np.loadtxt(f, delimiter=",") | 99 | try: |
100 | data = np.loadtxt(f, delimiter=",") | ||
101 | except Exception as e: | ||
102 | raise IOError("Cannot load '%s': %s" % (path, e.message)) | ||
100 | 103 | ||
101 | # Convert to tuples of ints if possible, else floats | 104 | # Convert to tuples of ints if possible, else floats |
102 | values = [map(lambda a:a if a%1 else int(a), t) for t in data] | 105 | values = [map(lambda a:a if a%1 else int(a), t) for t in data] |