Révision a5cc42ff

b/modules/config_arg.py
9 9
                        required=True)
10 10
    parser.add_argument('--debug',
11 11
                        help='Turns on debug verbosity')
12
    return parser.parse_args()
12
    return parser.parse_args()
b/modules/config_log.py
2 2
import logging
3 3

  
4 4

  
5
class ContextFilter(logging.Filter):
6

  
7
    def set_label(self, label):
8
        self.label = label
9

  
10
    def filter(self, record):
11

  
12
        record.label = self.label
13
        return True
14

  
15

  
16 5
def config_log(label):
17 6
    logger = logging.getLogger(label)
18 7
    logger.setLevel(logging.INFO)
b/modules/dos_input.py
585 585
    if return_vars['batch_q_sys'] != 'local' and not return_vars['subm_script']:
586 586
        sub_err = "'subm_script' must be provided if 'batch_q_sys' is not local"
587 587
        logger.error(sub_err)
588
        raise NoOptionError(opt, 'Global') # TODO Change to ValueError
588
        raise ValueError(sub_err)
589 589

  
590 590
    # Facultative options (Default/Fallback value present)
591 591
    return_vars['project_name'] = get_project_name()
......
657 657
        return_vars['energy_cutoff'] = get_energy_cutoff()
658 658
        # end energy_cutoff
659 659

  
660
    return_vars_str = "\n\t".join([str(key) + ": " + str(val)
661
                                   for key, val in return_vars.items()])
660
    return_vars_str = "\n\t".join([str(key) + ": " + str(value)
661
                                   for key, value in return_vars.items()])
662 662
    logger.info(
663 663
        f'Correctly read {in_file} parameters: \n\n\t{return_vars_str}\n')
664 664

  
b/modules/screening.py
6 6

  
7 7

  
8 8
def vect_avg(vects):
9
    """Computes the average of a set of vectors
9
    """Computes the element-wise mean of a set of vectors.
10 10

  
11 11
    @param vects: np.ndarray with shape (num_vectors, length_vector).
12
    @return: vector average computed doing the element-wise average.
12
    @return: vector average computed doing the element-wise mean.
13 13
    """
14 14
    from utilities import try_command
15 15
    err = "vect_avg parameter vects must be a list-like, able to be converted" \
......
23 23

  
24 24

  
25 25
def get_atom_coords(atoms: ase.Atoms, ctrs_list):
26
    """Gets the coordinates of the specified atoms from a ase.Atoms object.
27

  
28
    Given an ase.Atoms object and a list of atom indices specified in ctrs_list
29
    it gets the coordinates of the specified atoms. If the element in the
30
    ctrs_list is not an index but yet a list of indices, it computes the
31
    element-wise mean of the coordinates of the atoms specified in the inner
32
    list.
33
    @param atoms: ase.Atoms object for which to obtain the coordinates of.
34
    @param ctrs_list: list of (indices/list of indices) of the atoms for which
35
                      the coordinates should be extracted.
36
    @return: np.ndarray of atomic coordinates.
37
    """
26 38
    coords = []
27 39
    for i, elem in enumerate(ctrs_list):
28 40
        if isinstance(elem, list):
......
42 54

  
43 55

  
44 56
def ads_chemcat(site, ctr, pts_angle):
45
    pass
57
    return "TO IMPLEMENT"
46 58

  
47 59

  
48 60
def adsorb_confs(conf_list, surf, ads_ctrs, sites, algo, num_pts, neigh_ctrs):
61
    """Generates a number of adsorbate-surface structure coordinates.
62

  
63
    Given a list of conformers, a surface, a list of atom indices (or list of
64
    list of indices) of both the surface and the adsorbate, it generates a
65
    number of adsorbate-surface structures for every possible combination of
66
    them at different orientations.
67
    @param conf_list: list of ase.Atoms of the different conformers
68
    @param surf: the ase.Atoms object of the surface
69
    @param ads_ctrs: the list atom indices of the adsorbate.
70
    @param sites: the list of atom indices of the surface.
71
    @param algo: the algorithm to use for the generation of adsorbates.
72
    @param num_pts: the number of points per angle orientation to sample
73
    @param neigh_ctrs: the indices of the neighboring atoms to the adsorption
74
    atoms.
75
    @return: list of ase.Atoms for the adsorbate-surface structures
76
    """
49 77
    surf_ads_list = []
50 78
    sites_coords = get_atom_coords(surf, sites)
51 79
    for conf in conf_list:
......
67 95
    @param inp_vars: Calculation parameters from input file.
68 96
    """
69 97
    import os
70
    import numpy as np
71 98
    from modules.formats import read_coords, read_energies, \
72 99
        rdkit_mol_to_ase_atoms, adapt_format
73 100
    from modules.clustering import get_rmsd, clustering
74
    from modules.isolated import get_moments_of_inertia, get_neighbors
101
    from modules.isolated import get_moments_of_inertia
75 102
    from modules.calculation import run_calc
76 103

  
77 104
    if not os.path.isdir("isolated"):

Formats disponibles : Unified diff