Skip to content

Commit

Permalink
MAINT: don't hide exception on loading spikefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Caldwell committed Oct 2, 2020
1 parent cdda0aa commit 644be40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
9 changes: 1 addition & 8 deletions spikefn.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,7 @@ def get_times (self, gid, s_all):

def __get_extinput_times (self, fspk):
# load all spike times from file
s_all = []
try:
s_all = np.loadtxt(open(fspk, 'rb'))
except OSError:
print('Warning: could not read file:', fspk)
except ValueError:
print('Warning: error reading data from:', fspk)

s_all = np.loadtxt(open(fspk, 'rb'))
if len(s_all) == 0:
# couldn't read spike times
raise ValueError
Expand Down
6 changes: 1 addition & 5 deletions visrast.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@
PoissonInputs = paramrw.usingPoissonInputs(paramf)
outparamf = os.path.join(dconf['datdir'],paramf.split('.param')[0].split(os.path.sep)[-1],'param.txt')

try:
extinputs = spikefn.ExtInputs(spkpath, outparamf)
except ValueError:
print("Error: could not load spike timings from %s" % spkpath)

extinputs = spikefn.ExtInputs(spkpath, outparamf)
extinputs.add_delay_times()

alldat = {}
Expand Down

0 comments on commit 644be40

Please sign in to comment.