feat(code): Warn if findings studies do not match available

Since we add the studies that bring findings for the finding tables manually,
this ensures that we spot any mistakes when entering them, or similar
discrepancies on the other side of the raw data.
This commit is contained in:
Marty Oehme 2024-02-16 17:58:02 +01:00
parent 8cd6dc790d
commit 4e865ee2b5
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -19,9 +19,15 @@ def _combined_validities(
return
combined = 0.0
for study in apply_to.split(";"):
if study not in by_intervention["citation"].unique():
print(
f"WARNING: Findings table {study} study did not match any study in interventions dataframe!"
)
new = by_intervention.loc[by_intervention["citation"] == study, column]
if len(new) > 0 and not math.isnan(new.iat[0]):
combined += new.iat[0]
if len(new) == 0 or math.isnan(new.iat[0]):
continue
combined += new.iat[0]
if combined:
return _binned_strength(combined)
return r"\-"