more python3 related changes

This commit is contained in:
Martin Diehl 2018-11-17 08:46:58 +01:00
parent 558745b548
commit 82861e80bc
4 changed files with 7 additions and 7 deletions

@ -1 +1 @@
Subproject commit 923e5eaa2a24b0ac3b9b66e62394784596643d16
Subproject commit 6994385eb1eef00d9f35f047dc3c8a6382c3f41b

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys
@ -42,8 +42,8 @@ parser.set_defaults(whitelist = [],
(options,filenames) = parser.parse_args()
options.whitelist = map(int,options.whitelist)
options.blacklist = map(int,options.blacklist)
options.whitelist = list(map(int,options.whitelist))
options.blacklist = list(map(int,options.blacklist))
# --- loop over output files -------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,math,sys

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3
# -*- coding: UTF-8 no BOM -*-
import os,sys,math,random
@ -170,7 +170,7 @@ for name in filenames:
dtype=int,casting='unsafe') # find max grid indices within fraction
meshgrid = np.meshgrid(*map(np.arange,n),indexing='ij') # create a meshgrid within fraction
coords = np.vstack((meshgrid[0],meshgrid[1],meshgrid[2])).reshape(3,n.prod()).T # assemble list of 3D coordinates
seeds = ((random.sample(coords,options.N)+np.random.random(options.N*3).reshape(options.N,3))\
seeds = ((random.sample(list(coords),options.N)+np.random.random(options.N*3).reshape(options.N,3))\
/ \
(n/options.fraction)).T # pick options.N of those, rattle position,
# and rescale to fall within fraction