Skip to content

Commit

Permalink
Compare sizes instead of shapes for dimensionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisamarshall committed Jan 4, 2017
1 parent 7020ae1 commit 6f43aa0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ionize/Ion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ def __init__(self, name, valence, reference_pKa, reference_mobility,
'enthalpy',
'heat_capacity'):
if getattr(self, prop) is not None:
assert getattr(self, prop).shape == self.valence.shape, \
'{} must have the same shape as valence.'.format(prop)
template = 'In {}, valence is {}, while {} is {}. Wrong size.'
assert getattr(self, prop).size == self.valence.size, \
template.format(self.name, self.valence, prop,
getattr(self, prop))

assert np.all((self.reference_mobility / self.valence) > 0.), \
'Mobilities must be signed. {}, {}'.format(self.reference_mobility,
Expand Down
2 changes: 1 addition & 1 deletion ionize/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.1.2'
__version__ = '1.1.3'

0 comments on commit 6f43aa0

Please sign in to comment.