Skip to content

Commit

Permalink
Updated templst_pipeline to fix issues with UnboundLocalError: local …
Browse files Browse the repository at this point in the history
…variable 'args' referenced before assignment
  • Loading branch information
Acribbs committed Dec 31, 2024
1 parent b61fece commit dcc7f32
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/template_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,17 @@ def main(argv=None):
if argv is None:
argv = sys.argv

args = P.initialize(argv,
config_file="template.yml",
defaults={
"min_value": 0.0,
"num_samples": 1000,
"mu": 0.0,
"sigma": 1.0,
"to_cluster": not args.without_cluster}) # Set to_cluster based on without_cluster
# Get the args first
args = P.initialize(argv, config_file="template.yml")

# Then use them in the defaults dictionary
P.get_params().update({
"min_value": 0.0,
"num_samples": 1000,
"mu": 0.0,
"sigma": 1.0,
"to_cluster": not args.without_cluster # Now args is defined
})

pipeline = ruffus.Pipeline("template_pipeline")

Expand Down

0 comments on commit dcc7f32

Please sign in to comment.