do not patronize the user, rather give hints
This commit is contained in:
parent
7115382729
commit
903edcd429
|
@ -90,11 +90,7 @@ group.add_option( '-s',
|
||||||
'--selective',
|
'--selective',
|
||||||
action = 'store_true',
|
action = 'store_true',
|
||||||
dest = 'selective',
|
dest = 'selective',
|
||||||
help = 'selective picking of seed points from random seed points [%default]')
|
help = 'selective picking of seed points from random seed points')
|
||||||
group.add_option( '--force',
|
|
||||||
action = 'store_true',
|
|
||||||
dest = 'force',
|
|
||||||
help = 'try selective picking despite large seed point number [%default]')
|
|
||||||
group.add_option( '--distance',
|
group.add_option( '--distance',
|
||||||
dest = 'distance',
|
dest = 'distance',
|
||||||
type = 'float', metavar = 'float',
|
type = 'float', metavar = 'float',
|
||||||
|
@ -115,7 +111,6 @@ parser.set_defaults(randomSeed = None,
|
||||||
sigma = 0.05,
|
sigma = 0.05,
|
||||||
microstructure = 1,
|
microstructure = 1,
|
||||||
selective = False,
|
selective = False,
|
||||||
force = False,
|
|
||||||
distance = 0.2,
|
distance = 0.2,
|
||||||
numCandidates = 10,
|
numCandidates = 10,
|
||||||
format = None,
|
format = None,
|
||||||
|
@ -148,10 +143,11 @@ for name in filenames:
|
||||||
errors = []
|
errors = []
|
||||||
if gridSize == 0:
|
if gridSize == 0:
|
||||||
errors.append('zero grid dimension for {}.'.format(', '.join([['a','b','c'][x] for x in np.where(options.grid == 0)[0]])))
|
errors.append('zero grid dimension for {}.'.format(', '.join([['a','b','c'][x] for x in np.where(options.grid == 0)[0]])))
|
||||||
if options.N > gridSize/10.: errors.append('seed count exceeds 0.1 of grid points.')
|
if options.N > gridSize/10.:
|
||||||
|
remarks.append('seed count exceeds 0.1 of grid points.')
|
||||||
if options.selective and 4./3.*math.pi*(options.distance/2.)**3*options.N > 0.5:
|
if options.selective and 4./3.*math.pi*(options.distance/2.)**3*options.N > 0.5:
|
||||||
(remarks if options.force else errors).append('maximum recommended seed point count for given distance is {}.{}'.
|
remarks.append('maximum recommended seed point count for given distance is {}.{}'.
|
||||||
format(int(3./8./math.pi/(options.distance/2.)**3),'..'*options.force))
|
format(int(3./8./math.pi/(options.distance/2.)**3)))
|
||||||
|
|
||||||
if remarks != []: damask.util.croak(remarks)
|
if remarks != []: damask.util.croak(remarks)
|
||||||
if errors != []:
|
if errors != []:
|
||||||
|
|
Loading…
Reference in New Issue