Open emakarov opened 5 years ago
We're going to have to wrap a few of the math functions if we want to support Decimals in numpy-mode I think. Few numpy functions understand them, even when used as straight-up scalars, including some we need: sin, cos, radians, degrees, max and min. Interestingly sqrt is fine with them.
I'm not sure if numpy would consider this a bug.
I'm not sure about numpy strategy about Decimal support in future. The issue was found working with django project where lat/lon values are kept in decimals in database.
I see two options:
1) Consider this not a bug and raise specific Exception about attribute type (I think it's less preferred variant)
2) Cast Decimals to float
explicitly in the code of utm
the situation is also following:
if you call numpy.max with single float argument, it works if you call numpy.max with array of floats, it works if you call numpy.max with array of Decimals, it works if you call numpy.max with single Decimal, it fails
UTM version:
Numpy version:
(tested on some other numpy versions below 1.16.4)
Code:
fails with such traceback: