force type cast index to int for numpy array

Force type casting indices into int array to avoid warning:
 
VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future

For more info, see http://stackoverflow.com/questions/20084218/deprecation-warning-in-scikit-learn-svmlight-format-loader
This commit is contained in:
chen 2016-09-12 19:09:48 -04:00
parent 4cb27b76df
commit 804931db9e
1 changed files with 5 additions and 5 deletions

View File

@ -126,9 +126,9 @@ for name in filenames:
primPos = invRotation*gridpos # rotate back to primitive coordinate system
if np.dot(mask*primPos/dim,mask*primPos/dim) <= 0.25 and \
np.all(abs((1.-mask)*primPos/dim) <= 0.5): # inside ellipsoid and inside box
microstructure[(gridpos[0]+options.center[0])%info['grid'][0],
(gridpos[1]+options.center[1])%info['grid'][1],
(gridpos[2]+options.center[2])%info['grid'][2]] = options.fill # assign microstructure index
microstructure[int((gridpos[0]+options.center[0])%info['grid'][0]),
int((gridpos[1]+options.center[1])%info['grid'][1]),
int((gridpos[2]+options.center[2])%info['grid'][2])] = options.fill # assign microstructure index
newInfo['microstructures'] = microstructure.max()