import yaml


def load_TS_class(filename,
                  print_info=True):
    """ Load parameters and rules from yaml file to create time series.

    Returns dict.
    """

    with open(filename, 'r') as ymlfile:
        TS_def = yaml.load(ymlfile, Loader=yaml.SafeLoader)

    if print_info:
        print(TS_def['class_name'])
        print(TS_def['description'])
        print('n_channels:', TS_def['n_channels'])
        print('n_timepoints:', TS_def['n_timepoints'])

    return TS_def