Skip to content

Commit

Permalink
Remove a workaround for numpy < 1.7 (we now require numpy >= 1.8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstimberg committed Mar 12, 2015
1 parent 061a350 commit e67cfb2
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions brian2/units/fundamentalunits.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,18 +1560,6 @@ def cumprod(self, *args, **kwds): # pylint: disable=C0111
cumprod.__doc__ = np.ndarray.cumprod.__doc__


# Ok, this is a bit ugly: numpy 1.7 seems to have silently removed the setasflat
# method. We'll add it here dynamically to the Quantity class in case ndarray
# has it (i.e. for numpy < 1.7). On the other hand, this method is probably
# never used so maybe better to leave it away completely?
if hasattr(np.ndarray, 'setasflat'):
def setasflat(self, arr, **kwds): # pylint: disable=C0111
fail_for_dimension_mismatch(self, arr, 'setasflat')
super(Quantity, self).setasflat(np.asarray(arr), **kwds)
setasflat.__doc__ = np.ndarray.setasflat.__doc__
setattr(Quantity, setasflat.__name__, setasflat)


class Unit(Quantity):
r'''
A physical unit.
Expand Down

0 comments on commit e67cfb2

Please sign in to comment.