From 175250e470ea0ef667f0e144c3c8500537f61bde Mon Sep 17 00:00:00 2001 From: Anton Elmiger Date: Fri, 5 Apr 2024 16:30:51 +0200 Subject: [PATCH] hotfix-Refactor sampling_utils.py to handle different sample functions --- syclops/utility/sampling_utils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/syclops/utility/sampling_utils.py b/syclops/utility/sampling_utils.py index 7e4bf8e..98d9ef3 100644 --- a/syclops/utility/sampling_utils.py +++ b/syclops/utility/sampling_utils.py @@ -149,8 +149,13 @@ def apply_sampling(parameter, curr_frame=None, catalog=None): return parameter for sample_func in sample_functions: if sample_func in parameter: - return eval(f"sample_{sample_func}")( - parameter[sample_func], curr_frame, catalog - ) + if sample_func in ["selection_asset", "wildcard"]: + return eval(f"sample_{sample_func}")( + parameter[sample_func], curr_frame, catalog=catalog + ) + else: + return eval(f"sample_{sample_func}")( + parameter[sample_func], curr_frame + ) logging.warning("Parameter {0} not supported format".format(parameter)) raise ValueError("Parameter {0} not supported format".format(parameter))