mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
read_rwms output cleaned up
This commit is contained in:
parent
caa1330ab8
commit
c0cf1bb4c0
1 changed files with 6 additions and 7 deletions
|
@ -326,7 +326,6 @@ def read_array_openQCD2(fp):
|
|||
m *= n[i]
|
||||
|
||||
t = fp.read(m*size)
|
||||
#print("struct.calc tmp = "+str(struct.calcsize('%d%s' % (m, types))))
|
||||
tmp = struct.unpack('%d%s' % (m, types), t)
|
||||
|
||||
arr = parse_array_openQCD2(d, n, size, tmp, quadrupel=True)
|
||||
|
@ -350,11 +349,12 @@ def read_rwms(path, prefix, names=None, **kwargs):
|
|||
if not (ver_str in known_oqcd_versions):
|
||||
raise Exception('Unknown openQCD version defined!')
|
||||
else: #Set defaults for openQCD Version to be version 1.4, emulate the old behaviour of this method
|
||||
# Deprecate this kwarg in version 2.0.
|
||||
if 'new_format':
|
||||
ver_str = '1.6'
|
||||
else:
|
||||
ver_str = '1.4'
|
||||
print("Working with oQCD version:" + ver_str)
|
||||
print("Working with openQCD version " + ver_str)
|
||||
if 'postfix' in kwargs:
|
||||
postfix = kwargs.get('postfix')
|
||||
else:
|
||||
|
@ -416,7 +416,7 @@ def read_rwms(path, prefix, names=None, **kwargs):
|
|||
for k in range(nrw):
|
||||
deltas.append([])
|
||||
else:
|
||||
if ((nrw != struct.unpack('i', t)[0] and (not ver_str == '2.0')) or (nrw != struct.unpack('i', t)[0]/2 and ver_str == '2.0')):#little weird if-clause due to the /2 operation needed...
|
||||
if ((nrw != struct.unpack('i', t)[0] and (not ver_str == '2.0')) or (nrw != struct.unpack('i', t)[0]/2 and ver_str == '2.0')):# little weird if-clause due to the /2 operation needed.
|
||||
print('Error: different number of reweighting factors for replicum', rep)
|
||||
sys.exit()
|
||||
|
||||
|
@ -441,7 +441,6 @@ def read_rwms(path, prefix, names=None, **kwargs):
|
|||
if (ver_str == '2.0'):
|
||||
if not struct.unpack('i', fp.read(4))[0] == 0:
|
||||
print('something is wrong!')
|
||||
print('nfct:', nfct, 'nsrc:', nsrc)
|
||||
|
||||
#body
|
||||
while 0 < 1:
|
||||
|
|
Loading…
Add table
Reference in a new issue