From bc5e40c571dd43346a03e07bf86e9b84a4628bcd Mon Sep 17 00:00:00 2001 From: Antony Lewis Date: Wed, 14 Aug 2024 08:17:36 +0100 Subject: [PATCH] fix --- mflike/foreground.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mflike/foreground.py b/mflike/foreground.py index 9e41806..f4d3089 100644 --- a/mflike/foreground.py +++ b/mflike/foreground.py @@ -82,12 +82,13 @@ class ForegroundParamsTheory(Theory): @classmethod def get_class_options(cls, input_options={}): options = super().get_class_options().copy() - param_requested_cls = input_options.get( - 'requested_cls') or options.get('requested_cls', ['tt', 'te', 'ee']) - params = yaml_load(cls.get_text_file_content('params_common.yaml')) - for spec in param_requested_cls: - params |= yaml_load(cls.get_text_file_content('params_%s.yaml' % spec.upper())) - options["params"] = params + if cls is ForegroundParamsTheory: # only add params once + param_requested_cls = input_options.get( + 'requested_cls') or options.get('requested_cls', ['tt', 'te', 'ee']) + params = yaml_load(cls.get_text_file_content('params_common.yaml')) + for spec in param_requested_cls: + params |= yaml_load(cls.get_text_file_content('params_%s.yaml' % spec.upper())) + options["params"] = params return options