import yaml


def config_get_timesteps(filepath):
    """Get list of time steps from YAML configuration file.

    Parameters
    ----------
    filepath : pathlib.Path or str
        Path of the YAML configuration file.

    Returns
    -------
    list
        List of time-step indices (as a list of integers).

    """
    with open(filepath, 'r') as infile:
        config = yaml.safe_load(infile)['parameters']
    config.setdefault('startStep', 0)
    nstart, nt, nsave = config['startStep'], config['nt'], config['nsave']
    return list(range(nstart, nt + 1, nsave))