While trying to generate AST inputs by randomly sampling the physics model (using the --random_seds argument), I found what seems to be a bug in '~/beast/tools/run/make_ast_inputs.py'.
Lines 220–223 define 'random_seds' as an optional input for the sed sampling method (i.e. 'pick_method'):
220 if args.random_seds:
221 make_ast_inputs(
222 beast_settings_info=args.beast_settings_file, pick_method="random_seds"
223 )
Running make_ast_inputs with the --random_seds argument results in the following error:
UnboundLocalError: local variable 'chosen_seds' referenced before assignment
To my eye, this seems to be because there is no conditional block for "random_seds". However, a similar method name, "random_pick", is referenced starting on line 89.
While trying to generate AST inputs by randomly sampling the physics model (using the --random_seds argument), I found what seems to be a bug in '~/beast/tools/run/make_ast_inputs.py'.
Lines 220–223 define 'random_seds' as an optional input for the sed sampling method (i.e. 'pick_method'):
Running make_ast_inputs with the --random_seds argument results in the following error:
To my eye, this seems to be because there is no conditional block for "random_seds". However, a similar method name, "random_pick", is referenced starting on line 89.
Changing this line to
allows the function to run successfully and produces the expected output.