Repository: OpenFreeEnergy/gufe (language: python)

Issue:
improve 2d vis of mappings
previously would independently calculate 2D vis for each molecule, then RMS align these

now constrains second molecule's 2d representation to match that of the first molecule

overall improves the 2d vis generated, esp. when dealing with rotamers

before: (here atom 9L maps to atom 9R.  rdkit however assigns a more traditional sulfonamide layout)

![image (3)](https://github.com/OpenFreeEnergy/gufe/assets/9249543/d03bcd15-5e62-4a0d-bfc8-5db2ce0d519f)

after: (atom 9L & 9R are constrained.  This results in the H's having less layout room, but makes it clear why they didn't map)

![mapping_fixed](https://github.com/OpenFreeEnergy/gufe/assets/9249543/c89188f4-2176-46ed-a50a-2b183360a96e)




Discussion / hints:

Fix patch:
diff --git a/environment.yml b/environment.yml
index 4ca77fec..59a514b1 100644
--- a/environment.yml
+++ b/environment.yml
@@ -7,7 +7,7 @@ dependencies:
   - coverage
   - networkx
   - numpy
-  - openff-toolkit
+  - openff-toolkit >=0.13.0
   - openff-units >=0.2.0
   - openff-models >=0.0.4
   - pip


Test patch:
diff --git a/gufe/tests/test_smallmoleculecomponent.py b/gufe/tests/test_smallmoleculecomponent.py
index 109263fc..a449d65f 100644
--- a/gufe/tests/test_smallmoleculecomponent.py
+++ b/gufe/tests/test_smallmoleculecomponent.py
@@ -320,3 +320,16 @@ def test_missing_H_warning():
 
     with pytest.warns(UserWarning, match='removeHs=False'):
         _ = SmallMoleculeComponent(rdkit=m)
+
+
+def test_to_openff_5_membered_aromatics():
+    # see openfe #278
+    m = Chem.MolFromSmiles("c2scnc2C")
+    m = Chem.AddHs(m)
+    m.Compute2DCoords()
+
+    smc = SmallMoleculeComponent(m)
+
+    offm = smc.to_openff()
+
+    assert offm