From 2eabd95048d96a5e1dcdd44f1c88ffc71d6ab93c Mon Sep 17 00:00:00 2001 From: Pierre Bhoorasingh Date: Fri, 28 Mar 2014 11:58:46 -0400 Subject: [PATCH] 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. --- rmgpy/molecule/molecule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rmgpy/molecule/molecule.py b/rmgpy/molecule/molecule.py index 4fce5f23b2..cd1cac7104 100644 --- a/rmgpy/molecule/molecule.py +++ b/rmgpy/molecule/molecule.py @@ -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', @@ -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]