exa.common.sweep.util.convert_sweeps_to_list_of_tuples

exa.common.sweep.util.convert_sweeps_to_list_of_tuples#

convert_sweeps_to_list_of_tuples(sweeps)#

Validate sweeps and convert it to format accepted by the station control.

Converts a more lax sweep definition to a strict NdSweep. The sweeps themselves are the same, except single Sweep instances are turned into a ParallelSweep containing a single Sweep.

Verify that:

  • sweeps elements are either Sweep or ParallelSweep

  • ParallelSweep elements are Sweep

  • ParallelSweep contains at least one element

  • ParallelSweep component Sweeps all have equal-length data

Parameters:

sweeps (list[Sweep | tuple[Sweep, ...]]) – More user-friendly definition of a list of sweeps.

Returns:

Converted sweeps.

Raises:

ValidationErrorsweeps does not follow the contract.

Return type:

list[tuple[Sweep, …]]