Skip to content

Commit

Permalink
Edit init_from_rdkit_mol docstring (#414)
Browse files Browse the repository at this point in the history
Issues: #396

Added additional notes section in the docstring to explain that users
should kekulize their molecule prior to calling the
`init_form_rdkit_mol` method. It also explains the consequences of not
doing so (bond orders changed to integer values).

Co-authored-by: stevenbennett96 <stevenbennettonline@gmail.com>
  • Loading branch information
stevenkbennett and nevetse committed Dec 28, 2021
1 parent a8311fa commit 89fd450
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/stk/molecular/molecules/building_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def init_from_file(
)
# This remake needs to be here because molecules loaded
# with rdkit often have issues, because rdkit tries to do
# bits of structural analysis like stereocenters. remake
# bits of structural analysis like stereocenters. Remake
# gets rid of all this problematic metadata.
molecule = remake(cls._init_funcs[extension](path))

Expand All @@ -490,6 +490,13 @@ def init_from_rdkit_mol(
"""
Initialize from an :mod:`rdkit` molecule.
Notes
-----
For :mod:`rdkit` molecules with non-integer bond orders,
such as 1.5, the molecule should be kekulized prior to
calling this method. Otherwise, all bond orders will be
set to an integer value in the building block.
Parameters
----------
molecule : :class:`rdkit.Mol`
Expand Down

0 comments on commit 89fd450

Please sign in to comment.