Repository: duartegroup/autodE

Issue:
NCIComplex conformers are not generated correctly
**Describe the bug**
<!-- A clear and concise description of what the bug is. -->
NCI complex conformers are all generated with the same name, which means optimisations skip over all but the first one. The documentation water trimer works, but for other more complex surfaces this is not expected to.

**To Reproduce**
<!-- Steps to reproduce the behaviour: code with output -->

```
import autode as ade
from autode.species import NCIComplex

ade.Config.num_complex_sphere_points = 5
ade.Config.num_complex_random_rotations = 3

water = ade.Molecule(name='water', smiles='O')

trimer = NCIComplex(water, water, water, name='water_trimer')
trimer.find_lowest_energy_conformer(lmethod=ade.methods.XTB())
trimer.print_xyz_file()
```

The conformers directory only contains a single XTB output file

**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->

**Environment**
<!-- please complete the following information. -->
 - OS: CentOS
 - Version: v. 1.1.0


Comments:

Patch:
diff --git a/autode/conformers/conformers.py b/autode/conformers/conformers.py
index ef46de0..cda456e 100644
--- a/autode/conformers/conformers.py
+++ b/autode/conformers/conformers.py
@@ -147,7 +147,7 @@ class Conformers(list):
             if any(calc_heavy_atom_rmsd(conf.atoms, other.atoms) < rmsd_tol
                    for o_idx, other in enumerate(self) if o_idx != idx):
 
-                logger.info(f'Conformer {idx} was close in geometry to at'
+                logger.info(f'Conformer {idx} was close in geometry to at '
                             f'least one other - removing')
 
                 del self[idx]
diff --git a/autode/species/complex.py b/autode/species/complex.py
index a67efc8..31f7a66 100644
--- a/autode/species/complex.py
+++ b/autode/species/complex.py
@@ -166,7 +166,7 @@ class Complex(Species):
 
             for points in iterprod(points_on_sphere, repeat=n-1):
 
-                conf = Conformer(species=self, name=f'{self.name}_conf{n}')
+                conf = Conformer(species=self, name=f'{self.name}_conf{m}')
                 conf.atoms = get_complex_conformer_atoms(self._molecules,
                                                          rotations,
                                                          points)
diff --git a/doc/common/water_trimer.py b/doc/common/water_trimer.py
index 728b945..22aaea9 100644
--- a/doc/common/water_trimer.py
+++ b/doc/common/water_trimer.py
@@ -1,12 +1,12 @@
-from autode import Molecule, Config
+import autode as ade
 from autode.species import NCIComplex
-from autode.wrappers.XTB import xtb
 
-Config.num_complex_sphere_points = 5
-Config.num_complex_random_rotations = 3
+ade.Config.num_complex_sphere_points = 5
+ade.Config.num_complex_random_rotations = 3
+xtb = ade.methods.XTB()
 
 # Make a water molecule and optimise at the XTB level
-water = Molecule(name='water', smiles='O')
+water = ade.Molecule(name='water', smiles='O')
 water.optimise(method=xtb)
 
 # Make the NCI complex and find the lowest energy structure


Test patch:
diff --git a/tests/test_conformers.py b/tests/test_conformers.py
index 6f4581e..0a8f4e1 100644
--- a/tests/test_conformers.py
+++ b/tests/test_conformers.py
@@ -1,5 +1,5 @@
 from autode.atoms import Atom
-from autode.species import Molecule
+from autode.species import Molecule, NCIComplex
 from autode.conformers import Conformer, Conformers
 from autode.wrappers.ORCA import ORCA
 from autode.wrappers.XTB import XTB
@@ -14,6 +14,7 @@ from . import testutils
 import numpy as np
 import pytest
 import os
+import shutil
 
 here = os.path.dirname(os.path.abspath(__file__))
 orca = ORCA()
@@ -270,3 +271,17 @@ def test_calculation_over_no_conformers():
 
     # Should not raise an exception
     assert len(confs) == 0
+
+
+def test_complex_conformers_diff_names():
+
+    Config.num_complex_sphere_points = 2
+    Config.num_complex_random_rotations = 2
+
+    water = Molecule(smiles='O')
+    h2o_dimer = NCIComplex(water, water, name='dimer')
+    h2o_dimer._generate_conformers()
+    assert len(set(conf.name for conf in h2o_dimer.conformers)) > 1
+
+    if os.path.exists('conformers'):
+        shutil.rmtree('conformers')