Skip to content

Commit

Permalink
Fix test failures with latest pint version
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jun 17, 2016
1 parent 98528a0 commit 7519826
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions numtraits.py
Expand Up @@ -182,7 +182,7 @@ def identify_unit_framework(target_unit):

from pint.unit import UnitsContainer

if hasattr(target_unit, 'units') and isinstance(target_unit.units, UnitsContainer):
if hasattr(target_unit, 'dimensionality') and isinstance(target_unit.dimensionality, UnitsContainer):

return PINT

Expand Down Expand Up @@ -231,11 +231,11 @@ def assert_unit_convertability(name, value, target_unit, unit_framework):

from pint.unit import UnitsContainer

if not (hasattr(value, 'units') and isinstance(value.units, UnitsContainer)):
if not (hasattr(value, 'dimensionality') and isinstance(value.dimensionality, UnitsContainer)):
raise TraitError("{0} should be given as a Pint Quantity instance".format(name))

if value.dimensionality != target_unit.dimensionality:
raise TraitError("{0} should be in units convertible to {1}".format(name, target_unit.units))
raise TraitError("{0} should be in units convertible to {1}".format(name, target_unit))

elif unit_framework == QUANTITIES:

Expand Down

0 comments on commit 7519826

Please sign in to comment.