# pyerrors.input.utils API documentation

# pyerrors.input.utils

Utilities for the input

View Source

     1"""Utilities for the input"""
     2
     3
     4def check_idl(idl, che):
     5    """Checks if list of configurations is contained in an idl
     6
     7    Parameters
     8    ----------
     9    idl : range or list
    10        idl of the current replicum
    11    che : list
    12        list of configurations to be checked against
    13
    14    Returns
    15    -------
    16    miss_str : str
    17        string with integers of which idls are missing
    18    """
    19    missing = []
    20    for c in che:
    21        if c not in idl:
    22            missing.append(c)
    23    # print missing configurations such that it can directly be parsed to slurm terminal
    24    if not (len(missing) == 0):
    25        print(len(missing), "configs missing")
    26        miss_str = str(missing[0])
    27        for i in missing[1:]:
    28            miss_str += "," + str(i)
    29        print(miss_str)
    30    return miss_str

def check_idl(idl, che): View Source

     5def check_idl(idl, che):
     6    """Checks if list of configurations is contained in an idl
     7
     8    Parameters
     9    ----------
    10    idl : range or list
    11        idl of the current replicum
    12    che : list
    13        list of configurations to be checked against
    14
    15    Returns
    16    -------
    17    miss_str : str
    18        string with integers of which idls are missing
    19    """
    20    missing = []
    21    for c in che:
    22        if c not in idl:
    23            missing.append(c)
    24    # print missing configurations such that it can directly be parsed to slurm terminal
    25    if not (len(missing) == 0):
    26        print(len(missing), "configs missing")
    27        miss_str = str(missing[0])
    28        for i in missing[1:]:
    29            miss_str += "," + str(i)
    30        print(miss_str)
    31    return miss_str

Checks if list of configurations is contained in an idl

###### Parameters

- idl (range or list): idl of the current replicum
- che (list): list of configurations to be checked against

###### Returns

- miss_str (str): string with integers of which idls are missing