From f3ec8c6acf07956f6e35c0ffdae769fdbf3b7e0a Mon Sep 17 00:00:00 2001 From: Florez Ospina Juan Felipe Date: Wed, 29 Jan 2025 19:27:18 +0100 Subject: [PATCH] Fix typo, i was not properly accessing the key variables in the yaml dictionary --- pipelines/steps/apply_calibration_factors.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pipelines/steps/apply_calibration_factors.py b/pipelines/steps/apply_calibration_factors.py index 7532034..2590c7a 100644 --- a/pipelines/steps/apply_calibration_factors.py +++ b/pipelines/steps/apply_calibration_factors.py @@ -50,9 +50,11 @@ def apply_calibration_factors(data_table, calibration_factors): for variable_name in new_data_table.select_dtypes(include=["number"]).columns: if variable_name in calibration_factors['variables'].keys(): # use standard calibration factor + + #print(variable_name) # Extract numerator and denominator values - numerator = prod(calibration_factors[variable_name]['num']) - denominator = prod(calibration_factors[variable_name]['den']) + numerator = prod(calibration_factors['variables'][variable_name]['num']) + denominator = prod(calibration_factors['variables'][variable_name]['den']) # Apply calibration to each variable new_data_table[variable_name] = new_data_table[variable_name].mul((numerator / denominator))