commit a5cc42ff129234f2892c3ab7166d01ec68077e9d
Author: Carles Marti <carles.marti-aliod@ens-lyon.fr>
Date:   Mon Jun 15 08:44:06 2020 +0200

    Reformatting files, added documentation and getting rid of useless pieces of code.

diff --git a/modules/config_arg.py b/modules/config_arg.py
index 7fe8999..71a453c 100644
--- a/modules/config_arg.py
+++ b/modules/config_arg.py
@@ -9,4 +9,4 @@ def get_args():
                         required=True)
     parser.add_argument('--debug',
                         help='Turns on debug verbosity')
-    return parser.parse_args()
\ No newline at end of file
+    return parser.parse_args()
diff --git a/modules/config_log.py b/modules/config_log.py
index a93a1bb..9e2e900 100644
--- a/modules/config_log.py
+++ b/modules/config_log.py
@@ -2,17 +2,6 @@
 import logging
 
 
-class ContextFilter(logging.Filter):
-
-    def set_label(self, label):
-        self.label = label
-
-    def filter(self, record):
-
-        record.label = self.label
-        return True
-
-
 def config_log(label):
     logger = logging.getLogger(label)
     logger.setLevel(logging.INFO)
diff --git a/modules/dos_input.py b/modules/dos_input.py
index c2171ed..2b48dc7 100644
--- a/modules/dos_input.py
+++ b/modules/dos_input.py
@@ -585,7 +585,7 @@ def read_input(in_file):
     if return_vars['batch_q_sys'] != 'local' and not return_vars['subm_script']:
         sub_err = "'subm_script' must be provided if 'batch_q_sys' is not local"
         logger.error(sub_err)
-        raise NoOptionError(opt, 'Global') # TODO Change to ValueError
+        raise ValueError(sub_err)
 
     # Facultative options (Default/Fallback value present)
     return_vars['project_name'] = get_project_name()
@@ -657,8 +657,8 @@ def read_input(in_file):
         return_vars['energy_cutoff'] = get_energy_cutoff()
         # end energy_cutoff
 
-    return_vars_str = "\n\t".join([str(key) + ": " + str(val)
-                                   for key, val in return_vars.items()])
+    return_vars_str = "\n\t".join([str(key) + ": " + str(value)
+                                   for key, value in return_vars.items()])
     logger.info(
         f'Correctly read {in_file} parameters: \n\n\t{return_vars_str}\n')
 
diff --git a/modules/screening.py b/modules/screening.py
index 147fcfd..bf85ed2 100644
--- a/modules/screening.py
+++ b/modules/screening.py
@@ -6,10 +6,10 @@ logger = logging.getLogger('DockOnSurf')
 
 
 def vect_avg(vects):
-    """Computes the average of a set of vectors
+    """Computes the element-wise mean of a set of vectors.
 
     @param vects: np.ndarray with shape (num_vectors, length_vector).
-    @return: vector average computed doing the element-wise average.
+    @return: vector average computed doing the element-wise mean.
     """
     from utilities import try_command
     err = "vect_avg parameter vects must be a list-like, able to be converted" \
@@ -23,6 +23,18 @@ def vect_avg(vects):
 
 
 def get_atom_coords(atoms: ase.Atoms, ctrs_list):
+    """Gets the coordinates of the specified atoms from a ase.Atoms object.
+
+    Given an ase.Atoms object and a list of atom indices specified in ctrs_list
+    it gets the coordinates of the specified atoms. If the element in the
+    ctrs_list is not an index but yet a list of indices, it computes the
+    element-wise mean of the coordinates of the atoms specified in the inner
+    list.
+    @param atoms: ase.Atoms object for which to obtain the coordinates of.
+    @param ctrs_list: list of (indices/list of indices) of the atoms for which
+                      the coordinates should be extracted.
+    @return: np.ndarray of atomic coordinates.
+    """
     coords = []
     for i, elem in enumerate(ctrs_list):
         if isinstance(elem, list):
@@ -42,10 +54,26 @@ def ads_euler(site, ctr, pts_angle, neigh_ctr):
 
 
 def ads_chemcat(site, ctr, pts_angle):
-    pass
+    return "TO IMPLEMENT"
 
 
 def adsorb_confs(conf_list, surf, ads_ctrs, sites, algo, num_pts, neigh_ctrs):
+    """Generates a number of adsorbate-surface structure coordinates.
+
+    Given a list of conformers, a surface, a list of atom indices (or list of
+    list of indices) of both the surface and the adsorbate, it generates a
+    number of adsorbate-surface structures for every possible combination of
+    them at different orientations.
+    @param conf_list: list of ase.Atoms of the different conformers
+    @param surf: the ase.Atoms object of the surface
+    @param ads_ctrs: the list atom indices of the adsorbate.
+    @param sites: the list of atom indices of the surface.
+    @param algo: the algorithm to use for the generation of adsorbates.
+    @param num_pts: the number of points per angle orientation to sample
+    @param neigh_ctrs: the indices of the neighboring atoms to the adsorption
+    atoms.
+    @return: list of ase.Atoms for the adsorbate-surface structures
+    """
     surf_ads_list = []
     sites_coords = get_atom_coords(surf, sites)
     for conf in conf_list:
@@ -67,11 +95,10 @@ def run_screening(inp_vars):
     @param inp_vars: Calculation parameters from input file.
     """
     import os
-    import numpy as np
     from modules.formats import read_coords, read_energies, \
         rdkit_mol_to_ase_atoms, adapt_format
     from modules.clustering import get_rmsd, clustering
-    from modules.isolated import get_moments_of_inertia, get_neighbors
+    from modules.isolated import get_moments_of_inertia
     from modules.calculation import run_calc
 
     if not os.path.isdir("isolated"):
