From 980429e76eb46e031eeeac0de0f78f3727a39337 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:53:02 -0500 Subject: [PATCH] Quick fix for GH-373 Move the call to `get_static_arguments` under the 'emcee' inference branch. This avoids calling `outcomes.read_parameters_from_config` twice. That function has a side effect of editing the outcome modifiers config. See https://github.com/HopkinsIDD/flepiMoP/issues/373#issuecomment-2513640730 for details. --- flepimop/gempyor_pkg/src/gempyor/inference.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flepimop/gempyor_pkg/src/gempyor/inference.py b/flepimop/gempyor_pkg/src/gempyor/inference.py index ecc96a99c..8e2076f3f 100644 --- a/flepimop/gempyor_pkg/src/gempyor/inference.py +++ b/flepimop/gempyor_pkg/src/gempyor/inference.py @@ -392,14 +392,14 @@ def __init__( self.already_built = False # whether we have already built the costly objects that need just one build self.autowrite_seir = autowrite_seir - self.static_sim_arguments = get_static_arguments(self.modinf) - ## Inference Stuff self.do_inference = False if config["inference"].exists(): from . import inference_parameter, logloss if config["inference"]["method"].get("default") == "emcee": + # Generates the static_sim_arguments only if this is a config argument. + self.static_sim_arguments = get_static_arguments(self.modinf) self.do_inference = True self.inference_method = "emcee" self.inferpar = inference_parameter.InferenceParameters(