small renamings

This commit is contained in:
Justus Kuhlmann 2025-11-03 15:42:39 +00:00
commit e2649b3074

View file

@ -101,7 +101,7 @@ def read_rwms(path: str, prefix: str, version: str='2.0', names: Optional[list[s
r_stop_index = [] r_stop_index = []
for rep in range(replica): for rep in range(replica):
tmp_array: list[list] = [] tmp_array: list[list[float]] = []
with open(path + '/' + ls[rep], 'rb') as fp: with open(path + '/' + ls[rep], 'rb') as fp:
t = fp.read(4) # number of reweighting factors t = fp.read(4) # number of reweighting factors
@ -162,8 +162,8 @@ def read_rwms(path: str, prefix: str, version: str='2.0', names: Optional[list[s
for j in range(nfct[i]): for j in range(nfct[i]):
t = fp.read(8 * nsrc[i]) t = fp.read(8 * nsrc[i])
t = fp.read(8 * nsrc[i]) t = fp.read(8 * nsrc[i])
tmp_rw: list[float] = struct.unpack('d' * nsrc[i], t) tmp_rw_unpacked = struct.unpack('d' * nsrc[i], t)
tmp_nfct *= np.mean(np.exp(-np.asarray(tmp_rw))) tmp_nfct *= np.mean(np.exp(-np.asarray(tmp_rw_unpacked)))
if print_err: if print_err:
print(config_no, i, j, print(config_no, i, j,
np.mean(np.exp(-np.asarray(tmp_rw))), np.mean(np.exp(-np.asarray(tmp_rw))),
@ -383,9 +383,9 @@ def _extract_flowed_energy_density(path: str, prefix: str, dtr_read: int, xmin:
E_dict = {} E_dict = {}
for n in range(nn + 1): for n in range(nn + 1):
samples: list[list[float]] = [] samples: list[list[float]] = []
for nrep, rep in enumerate(Ysum): for nrep, rep_data in enumerate(Ysum):
samples.append([]) samples.append([])
for cnfg in rep: for cnfg in rep_data:
samples[-1].append(cnfg[n]) samples[-1].append(cnfg[n])
samples[-1] = samples[-1][r_start_index[nrep]:r_stop_index[nrep] + 1][::r_step] samples[-1] = samples[-1][r_start_index[nrep]:r_stop_index[nrep] + 1][::r_step]
new_obs = Obs(samples, rep_names, idl=idl) new_obs = Obs(samples, rep_names, idl=idl)