Skip to content

Commit

Permalink
Sets molecule coordinate to an empty numpy array
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pierrelb committed Mar 28, 2014
1 parent baa1567 commit 2eabd95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rmgpy/molecule/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
from .atomtype import AtomType, atomTypes, getAtomType
import rmgpy.constants as constants

import numpy

#: This dictionary is used to shortcut lookups of a molecule's SMILES string from its chemical formula.
_known_smiles_molecules = {
'N2': 'N#N',
Expand Down Expand Up @@ -107,7 +109,7 @@ class Atom(Vertex):
e.g. ``atom.symbol`` instead of ``atom.element.symbol``.
"""

def __init__(self, element=None, radicalElectrons=0, spinMultiplicity=1, charge=0, label='', lonePairs=0, coords=None):
def __init__(self, element=None, radicalElectrons=0, spinMultiplicity=1, charge=0, label='', lonePairs=0, coords=numpy.array([])):
Vertex.__init__(self)
if isinstance(element, str):
self.element = elements.__dict__[element]
Expand Down

0 comments on commit 2eabd95

Please sign in to comment.