Closing, there is a
from functools import wraps, reduce
in core.py
Appears to be an issue again. No reduce import in core.py. Install source is PyPi.
from natu.units import N
print(repr(1.0 * N))
Traceback (most recent call last):
File "~/.pyenv/versions/scientific/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-4-9b28d8840f52>", line 1, in <module>
print(repr(1 * N))
File "~/.pyenv/versions/scientific/lib/python3.7/site-packages/natu/core.py", line 823, in __repr__
return format(self, 'g')
File "~/.pyenv/versions/scientific/lib/python3.7/site-packages/natu/core.py", line 357, in wrapped
unit = unitspace(**display_unit)
File "~/.pyenv/versions/scientific/lib/python3.7/site-packages/natu/core.py", line 1374, in __call__
return reduce(lambda x, y: x * y, factors)
NameError: name 'reduce' is not defined
Originally posted by @MinhHaDuong in https://github.com/kdavies4/natu/issues/28#issuecomment-322365432 :
Appears to be an issue again. No
reduce
import in core.py. Install source is PyPi.Although it appears to be in master: