Allow specifying different grid dimensions for each parameter
Closed this issue · 0 comments
Current the create_dict_sweep
function in ensemble_tool
and by extension the make_sweep_dir
script only allows specifying a single n_divs
argument for setting the number of parameter values along each axis of the parameter grid. We might want to specify grids with variable resolutions across the different parameters. This should be easy to support by having parameter_dict
argument values be tuples of three values, with the first value the start point of range, second value the end point and third value the number of linearly spaced points to use across range, equivalent to the arguments to numpy.linspace
.
So for example create_dict_sweep(..., parameter_dict={"particle_initial_velocity": (0.5, 1.5, 3), "particle_charge_density": (90, 110, 2)}")
would correspond to the grid of parameter combinations
[
{"particle_initial_velocity: 0.5, "particle_charge_density": 90},
{"particle_initial_velocity: 0.5, "particle_charge_density": 100},
{"particle_initial_velocity: 1.0, "particle_charge_density": 90},
{"particle_initial_velocity: 1.0, "particle_charge_density": 100},
{"particle_initial_velocity: 1.5, "particle_charge_density": 90},
{"particle_initial_velocity: 1.5, "particle_charge_density": 100},
]