exa.core.experiment.utils.sweep_utils.update_options_for_default_sweeps

exa.core.experiment.utils.sweep_utils.update_options_for_default_sweeps#

update_options_for_default_sweeps(default_sweeps, default_options)#

Change the default sweep options but otherwise keeping the sweep definitions.

Parameters:
  • default_sweeps (list[tuple[Sweep, ...]]) – the default sweeps.

  • default_options (list[None | SweepOptions | ndarray | tuple[SweepOptions | ndarray]] | dict[str | Parameter, SweepOptions | ndarray]) – the new default options to be applied to the sweeps. The new options can be given either as list of the same length as the default sweeps and containing the same tuple structure or as a dict where the keys are the sweep parameters or the sweep parameter names, and the values of the new options. If a dict is given, only the sweeps or parts of parallel sweeps found in the keys, will be altered.

Returns:

The default sweeps with the modified options.

Raises:

ValueError – if the default_sweeps and default_options lists are of different lengths or a tuple of options is to be applied to a non-tuple sweep.

Return type:

list[tuple[Sweep, …]]