Repository: atomistic-machine-learning/schnetpack

Issue:
No inheritance of ASEEnvironmentProvider
https://github.com/atomistic-machine-learning/schnetpack/blob/9caa03c5ca27ab17f02201c4146487c8917521f3/src/schnetpack/environment.py#L55

There are no functional issues, but I think `ASEEnvironmentProvider` should inherit `BaseEnvironmentProvider` like below.

```python
class ASEEnvironmentProvider(BaseEnvironmentProvider):
```

And in my opinion, the name of the class should be changed to `AseEnvironmentProvider` because in the other module (e.g., `md`) the word `Ase` is used for ASE related classes (e.g., `md.AseInterface`).  The naming conventions should be used consistently.

Discussion:

Patch:
diff --git a/src/schnetpack/datasets/matproj.py b/src/schnetpack/datasets/matproj.py
index 03fb3ea..d81f8ac 100644
--- a/src/schnetpack/datasets/matproj.py
+++ b/src/schnetpack/datasets/matproj.py
@@ -6,7 +6,7 @@ from ase.db import connect
 from ase.units import eV
 
 from schnetpack.data import AtomsData
-from schnetpack.environment import ASEEnvironmentProvider
+from schnetpack.environment import AseEnvironmentProvider
 
 __all__ = [
     'MaterialsProject'
@@ -48,7 +48,7 @@ class MaterialsProject(AtomsData):
 
         self.dbpath = dbpath
 
-        environment_provider = ASEEnvironmentProvider(cutoff)
+        environment_provider = AseEnvironmentProvider(cutoff)
 
         if properties is None:
             properties = MaterialsProject.available_properties
diff --git a/src/schnetpack/datasets/omdb.py b/src/schnetpack/datasets/omdb.py
index 34a7d72..d954242 100644
--- a/src/schnetpack/datasets/omdb.py
+++ b/src/schnetpack/datasets/omdb.py
@@ -8,7 +8,7 @@ from ase.db import connect
 from ase.units import eV
 
 from schnetpack.data import AtomsData
-from schnetpack.environment import ASEEnvironmentProvider
+from schnetpack.environment import AseEnvironmentProvider
 
 __all__ = [
     'OrganicMaterialsDatabase'
@@ -57,7 +57,7 @@ class OrganicMaterialsDatabase(AtomsData):
             raise FileNotFoundError('Download OMDB dataset (e.g. OMDB-GAP1.tar.gz) from https://omdb.diracmaterials.org/dataset/ and set datapath to this file')
 
 
-        environment_provider = ASEEnvironmentProvider(cutoff)
+        environment_provider = AseEnvironmentProvider(cutoff)
 
         if download and not os.path.exists(self.dbpath):
             # Convert OMDB .tar.gz into a .db file
diff --git a/src/schnetpack/environment.py b/src/schnetpack/environment.py
index 673a4b8..2693d28 100644
--- a/src/schnetpack/environment.py
+++ b/src/schnetpack/environment.py
@@ -4,8 +4,10 @@ from ase.neighborlist import neighbor_list
 
 class BaseEnvironmentProvider:
     """
-    Environment Providers are supposed to collect neighboring atoms within local, atom-centered environments.
-    All environment providers should inherit from this class.
+    Environment Providers are supposed to collect neighboring atoms within
+    local, atom-centered environments. All environment providers should inherit
+    from this class.
+
     """
 
     def get_environment(self, idx, atoms):
@@ -17,9 +19,11 @@ class BaseEnvironmentProvider:
             atoms (ase.Atoms): atomistic system
 
         Returns:
-            neighborhood_idx (np.ndarray): indices of the neighbors with shape n_atoms x n_max_neighbors
-            offset (np.ndarray): offset in lattice coordinates for periodic systems (otherwise zero matrix) of
-            shape n_atoms x n_max_neighbors x 3
+            neighborhood_idx (np.ndarray): indices of the neighbors with shape
+                n_atoms x n_max_neighbors
+            offset (np.ndarray): offset in lattice coordinates for periodic
+                systems (otherwise zero matrix) of shape
+                n_atoms x n_max_neighbors x 3
 
         '''
 
@@ -28,8 +32,9 @@ class BaseEnvironmentProvider:
 
 class SimpleEnvironmentProvider(BaseEnvironmentProvider):
     '''
-    A simple environment provider for small molecules where all atoms are each other's neighbors.
-    It calculates full distance matrices and does not support cutoffs or periodic boundary conditions.
+    A simple environment provider for small molecules where all atoms are each
+    other's neighbors. It calculates full distance matrices and does not
+    support cutoffs or periodic boundary conditions.
     '''
 
     def get_environment(self, idx, atoms, grid=None):
@@ -39,23 +44,32 @@ class SimpleEnvironmentProvider(BaseEnvironmentProvider):
             neighborhood_idx = -np.ones((1, 1), dtype=np.float32)
             offsets = np.zeros((n_atoms, 1, 3), dtype=np.float32)
         else:
-            neighborhood_idx = np.tile(np.arange(n_atoms, dtype=np.float32)[np.newaxis], (n_atoms, 1))
-            neighborhood_idx = neighborhood_idx[~np.eye(n_atoms, dtype=np.bool)].reshape(n_atoms, n_atoms - 1)
+            neighborhood_idx = np.tile(
+                np.arange(n_atoms, dtype=np.float32)[np.newaxis], (n_atoms, 1))
+            neighborhood_idx = neighborhood_idx[
+                ~np.eye(n_atoms, dtype=np.bool)].reshape(n_atoms, n_atoms - 1)
 
             if grid is not None:
                 n_grid = grid.shape[0]
-                neighborhood_idx = np.hstack([neighborhood_idx, -np.ones((n_atoms, 1))])
-                grid_nbh = np.tile(np.arange(n_atoms, dtype=np.float32)[np.newaxis], (n_grid, 1))
+                neighborhood_idx = np.hstack(
+                    [neighborhood_idx, -np.ones((n_atoms, 1))])
+                grid_nbh = np.tile(
+                    np.arange(n_atoms, dtype=np.float32)[np.newaxis],
+                    (n_grid, 1))
                 neighborhood_idx = np.vstack([neighborhood_idx, grid_nbh])
 
-            offsets = np.zeros((neighborhood_idx.shape[0], neighborhood_idx.shape[1], 3), dtype=np.float32)
+            offsets = np.zeros(
+                (neighborhood_idx.shape[0], neighborhood_idx.shape[1], 3),
+                dtype=np.float32)
         return neighborhood_idx, offsets
 
 
-class ASEEnvironmentProvider:
-    '''
-    Environment provider making use of ASE neighbor lists. Supports cutoffs and PBCs.
-    '''
+class AseEnvironmentProvider(BaseEnvironmentProvider):
+    """
+    Environment provider making use of ASE neighbor lists. Supports cutoffs
+    and PBCs.
+
+    """
 
     def __init__(self, cutoff):
         self.cutoff = cutoff
@@ -65,20 +79,24 @@ class ASEEnvironmentProvider:
             raise NotImplementedError
 
         n_atoms = atoms.get_number_of_atoms()
-        idx_i, idx_j, idx_S = neighbor_list('ijS', atoms, self.cutoff, self_interaction=False)
+        idx_i, idx_j, idx_S = neighbor_list('ijS', atoms, self.cutoff,
+                                            self_interaction=False)
         if idx_i.shape[0] > 0:
             uidx, n_nbh = np.unique(idx_i, return_counts=True)
             n_max_nbh = np.max(n_nbh)
 
             n_nbh = np.tile(n_nbh[:, np.newaxis], (1, n_max_nbh))
-            nbh_range = np.tile(np.arange(n_max_nbh, dtype=np.int)[np.newaxis], (n_nbh.shape[0], 1))
+            nbh_range = np.tile(np.arange(n_max_nbh, dtype=np.int)[np.newaxis],
+                                (n_nbh.shape[0], 1))
 
             mask = np.zeros((n_atoms, np.max(n_max_nbh)), dtype=np.bool)
             mask[uidx, :] = nbh_range < n_nbh
-            neighborhood_idx = -np.ones((n_atoms, np.max(n_max_nbh)), dtype=np.float32)
+            neighborhood_idx = -np.ones((n_atoms, np.max(n_max_nbh)),
+                                        dtype=np.float32)
             neighborhood_idx[mask] = idx_j
 
-            offset = np.zeros((n_atoms, np.max(n_max_nbh), 3), dtype=np.float32)
+            offset = np.zeros((n_atoms, np.max(n_max_nbh), 3),
+                              dtype=np.float32)
             offset[mask] = idx_S
         else:
             neighborhood_idx = -np.ones((n_atoms, 1), dtype=np.float32)
@@ -89,7 +107,8 @@ class ASEEnvironmentProvider:
 
 def collect_atom_triples(nbh_idx):
     """
-    Collect all valid triples of atoms by rearranging neighbor indices obtained from an environment provider.
+    Collect all valid triples of atoms by rearranging neighbor indices obtained
+    from an environment provider.
 
     Args:
         nbh_idx (numpy.ndarray): neighbor indices


Test patch:
diff --git a/tests/test_environment.py b/tests/test_environment.py
index 5199e1b..0d0fed9 100644
--- a/tests/test_environment.py
+++ b/tests/test_environment.py
@@ -39,7 +39,7 @@ def simple_env():
 
 @pytest.fixture
 def ase_env():
-    return env.ASEEnvironmentProvider(10.)
+    return env.AseEnvironmentProvider(10.)
 
 
 def test_single_atom(single_atom, simple_env, ase_env):