pyerrors.input.utils

Utilities for the input

View Source
 0"""Utilities for the input"""
 1
 2
 3def check_idl(idl, che):
 4    """Checks if list of configurations is contained in an idl
 5
 6    Parameters
 7    ----------
 8    idl : range or list
 9        idl of the current replicum
10    che : list
11        list of configurations to be checked against
12    """
13    missing = []
14    for c in che:
15        if c not in idl:
16            missing.append(c)
17    # print missing configurations such that it can directly be parsed to slurm terminal
18    if not (len(missing) == 0):
19        print(len(missing), "configs missing")
20        miss_str = str(missing[0])
21        for i in missing[1:]:
22            miss_str += "," + str(i)
23        print(miss_str)
#   def check_idl(idl, che):
View Source
 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    missing = []
15    for c in che:
16        if c not in idl:
17            missing.append(c)
18    # print missing configurations such that it can directly be parsed to slurm terminal
19    if not (len(missing) == 0):
20        print(len(missing), "configs missing")
21        miss_str = str(missing[0])
22        for i in missing[1:]:
23            miss_str += "," + str(i)
24        print(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