Closed pbrod closed 7 years ago
I cannot reproduce the issue. It seems to me that
x_shp = numpy.shape(x)
always returns a tuple of integers and numpy.prod would also return an integer.
Please provide a self contained example and post your output here. Please also include
print(numpy.__version__)
print(algopy.__version__)
in your script.
Well not all the time. If x is a scalar then numpy.shape(1) == () and numpy.prod(()) returns a float.
>>> import numpy as np
>>> np.__version__
'1.12.1'
>>> np.prod(())
1.0
However, if x have a shape different from (), then numpy.prod(x_shp) returns a int and everything is ok.
np.prod((1, 23)) 23 algopy.version '0.5.3'
numpy no longer accepts shapes given as floats. Thus UTPM crashes due to shapes given as float on line 208: https://github.com/b45ch1/algopy/blob/master/algopy/utpm/utpm.py#L208
I would propose to replace that line with these twolines: