diff --git a/moldesign/_tests/helpers.py b/moldesign/_tests/helpers.py index 269244f..b210754 100644 --- a/moldesign/_tests/helpers.py +++ b/moldesign/_tests/helpers.py @@ -32,7 +32,7 @@ def _make_mol_with_n_hydrogens(n): return mdt.Molecule([mdt.Atom('H') for i in xrange(n)]) -class ZeroEnergy(mdt.models.EnergyModelBase): +class ZeroEnergy(mdt.models.base.EnergyModelBase): """ All 0, all the time """ def prep(self): diff --git a/moldesign/compute/configuration.py b/moldesign/compute/configuration.py index dec22ab..e77a7db 100644 --- a/moldesign/compute/configuration.py +++ b/moldesign/compute/configuration.py @@ -92,7 +92,7 @@ default_python_image=None, default_docker_host='unix://var/run/docker.sock', default_docker_machine='default', - default_version_tag='0.7.2') + default_version_tag='0.7.3') DEF_CONFIG = CONFIG_DEFAULTS.copy() """ dict: default configuration to be written to moldesign.yml if it doesn't exist diff --git a/moldesign/molecules/bonds.py b/moldesign/molecules/bonds.py index 01ee940..c0460b9 100644 --- a/moldesign/molecules/bonds.py +++ b/moldesign/molecules/bonds.py @@ -27,7 +27,8 @@ class Bond(object): Notes: Comparisons and hashes involving bonds will return True if the atoms involved in the bonds - are the same. Bond orders are not compared. + are the same. Bond orders are not compared. + These objects are used to represent and pass bond data only - they are not used for storage. Attributes: diff --git a/moldesign/units/quantity.py b/moldesign/units/quantity.py index 643ff05..431b1ad 100644 --- a/moldesign/units/quantity.py +++ b/moldesign/units/quantity.py @@ -17,6 +17,7 @@ import operator import copy from os.path import join, abspath, dirname +import numbers import numpy as np from pint import UnitRegistry, set_application_registry, DimensionalityError @@ -95,7 +96,9 @@ def __setitem__(self, key, value): if not hasattr(value, 'value_in'): # deal with missing `value_in` method if self.dimensionless: # case 1: this is OK if self is dimensionless self.magnitude[key] = value - else: # case 2: User tried to pass a number without units + elif not isinstance(value, numbers.Number): # case 2: this is not a number + raise TypeError('"%s" is not a valid numeric value' % value) + else: # case 3: wrong units raise DimensionalityError(self.units, ureg.dimensionless) else: # case 3: attribute error is unrelated to this raise