mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 23:00:25 +01:00
Merge pull request #72 from jkuhl-uni/feature/input_2.0
bug fix: read methods are in fact closing files now
This commit is contained in:
commit
116dd67e53
1 changed files with 4 additions and 0 deletions
|
@ -211,6 +211,7 @@ def read_sfcf(path, prefix, name, quarks='.*', corr_type='bi', noffset=0, wf=0,
|
||||||
read = 1
|
read = 1
|
||||||
start = k + 1
|
start = k + 1
|
||||||
print(str(T) + " entries found.")
|
print(str(T) + " entries found.")
|
||||||
|
file.close()
|
||||||
else:
|
else:
|
||||||
pattern = 'name ' + name + '\nquarks ' + quarks + '\noffset ' + str(noffset) + '\nwf ' + str(wf)
|
pattern = 'name ' + name + '\nquarks ' + quarks + '\noffset ' + str(noffset) + '\nwf ' + str(wf)
|
||||||
if b2b:
|
if b2b:
|
||||||
|
@ -230,8 +231,11 @@ def read_sfcf(path, prefix, name, quarks='.*', corr_type='bi', noffset=0, wf=0,
|
||||||
T = content[match.start():].count('\n', 0, end_match.start()) - 4 - b2b
|
T = content[match.start():].count('\n', 0, end_match.start()) - 4 - b2b
|
||||||
assert T > 0
|
assert T > 0
|
||||||
print(T, 'entries, starting to read in line', start_read)
|
print(T, 'entries, starting to read in line', start_read)
|
||||||
|
file.close()
|
||||||
else:
|
else:
|
||||||
|
file.close()
|
||||||
raise Exception('Correlator with pattern\n' + pattern + '\nnot found.')
|
raise Exception('Correlator with pattern\n' + pattern + '\nnot found.')
|
||||||
|
|
||||||
# we found where the correlator
|
# we found where the correlator
|
||||||
# that is to be read is in the files
|
# that is to be read is in the files
|
||||||
# after preparing the datastructure
|
# after preparing the datastructure
|
||||||
|
|
Loading…
Add table
Reference in a new issue