Skip to content

Commit

Permalink
hotfix-Refactor sampling_utils.py to handle different sample functions
Browse files Browse the repository at this point in the history
  • Loading branch information
aelmiger committed Apr 5, 2024
1 parent 264ba68 commit 175250e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions syclops/utility/sampling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 175250e

Please sign in to comment.