Kfactors for compound datasets
Created by: giacomomagni
While trying to implement new k-factors
files I found a potential bug.
CF
files with the new FK tables
naming convention are not correctly loaded from the ymldb
in case of compound observables.
In particular in loader.py CF
names should be read from 'operands'
and not 'target_dataset'
.
I propose the following fix:
cfac_name = metadata["target_dataset"]
# check whether there is a compound file
cpath = theory.path / "compound" / f"FK_{cfac_name}-COMPOUND.dat"
if cpath.exists():
# Get the target filenames
tnames = [i[3:-4] for i in cpath.read_text().split() if i.endswith(".dat")]
cfactors = [self.check_cfactor(theoryID, i, cfac) for i in tnames]
else:
cfac_name = metadata["operands"]
cfactors = []
for operand in cfac_name:
for fk_tab in operand:
cfactors.append(self.check_cfactor(theoryID, fk_tab, cfac))
###
I suggest to deprecate or raise an error or a warning when the the folder compound
is still present in a theory following the new naming convention, as this can lead to potential inconsistencies.