Skip to content

Commit 2eabd95

Browse files
committed
Sets molecule coordinate to an empty numpy array
Setting it as `None` led to other problems. It will be set to an empty array as default, and as a filled array with 3 values (x, y, and z coordinates) when determined.
1 parent baa1567 commit 2eabd95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rmgpy/molecule/molecule.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
from .atomtype import AtomType, atomTypes, getAtomType
5151
import rmgpy.constants as constants
5252

53+
import numpy
54+
5355
#: This dictionary is used to shortcut lookups of a molecule's SMILES string from its chemical formula.
5456
_known_smiles_molecules = {
5557
'N2': 'N#N',
@@ -107,7 +109,7 @@ class Atom(Vertex):
107109
e.g. ``atom.symbol`` instead of ``atom.element.symbol``.
108110
"""
109111

110-
def __init__(self, element=None, radicalElectrons=0, spinMultiplicity=1, charge=0, label='', lonePairs=0, coords=None):
112+
def __init__(self, element=None, radicalElectrons=0, spinMultiplicity=1, charge=0, label='', lonePairs=0, coords=numpy.array([])):
111113
Vertex.__init__(self)
112114
if isinstance(element, str):
113115
self.element = elements.__dict__[element]

0 commit comments

Comments
 (0)