-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Update numpy deprecation of product and test dependency issues #38
Conversation
@rrsettgast - it looks like this fixed the deprecation issue on the CI machine |
ta = np.ascontiguousarray( np.squeeze( ta ) ) | ||
tb = np.ascontiguousarray( np.squeeze( tb ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the issue we ran into was due to these time vectors changing shape from (N,) to (N, 1) was the issue that triggered the interpolation issue.
xc = np.reshape( xa, ( N[ 0 ], S ) ) | ||
xd = np.zeros( ( len( tb ), S ) ) | ||
for ii in range( S ): | ||
xd[ :, ii ] = interp1d( ta, xc[ :, ii ] )( tb ) | ||
xd[ :, ii ] = interp1d( ta, xc[ :, ii ], bounds_error=False, fill_value='extrapolate' )( tb ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's often not great, but I'm allowing the interpolator to extrapolate the comparison here (there will always be an error in this case due to changes in the time vector though... this is purely to check how much the curves changed if they were on the same time basis)
|
||
if ( len( N ) == 1 ): | ||
return interp1d( ta, xa )( tb ) | ||
else: | ||
# Reshape the input array so that we can work on the non-time axes | ||
S = np.product( N[ 1: ] ) | ||
S = np.prod( N[ 1: ] ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the numpy.product deprecation
Temporary testing branch: GEOS-DEV/GEOS#3328