Skip to content

Commit

Permalink
Redirect "result" flag value to "output" flag
Browse files Browse the repository at this point in the history
Conceptual compatibility - don't want people who script terminal/command line interactions to be surprised by change of argument attribute names
  • Loading branch information
ConnectedSystems committed Nov 11, 2018
1 parent a3a93c4 commit 75f0ebc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion SALib/sample/common_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def setup(parser):
'-p', '--paramfile', type=str, required=True,
help='Parameter Range File')
parser.add_argument(
'-r', '--result', type=str, required=True, help='Output File')
'-r', '--result', type=str, required=True, help='Output File',
dest='output')
parser.add_argument(
'-s', '--seed', type=int, required=False, default=None,
help='Random Seed')
Expand Down
2 changes: 1 addition & 1 deletion SALib/sample/fast_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def run_sample(args):
np.random.seed(args.seed)
problem = read_param_file(args.paramfile)
param_values = sample(problem, N=args.samples, M=args.M)
np.savetxt(args.result, param_values, delimiter=args.delimiter,
np.savetxt(args.output, param_values, delimiter=args.delimiter,
fmt='%.' + str(args.precision) + 'e')


Expand Down
4 changes: 2 additions & 2 deletions SALib/sample/ff.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def sample(problem):
sample : :class:`numpy.array`
"""

contrast = generate_contrast(problem)
sample = np.array((contrast + 1.) / 2, dtype=np.float)
problem = extend_bounds(problem)
Expand Down Expand Up @@ -138,9 +137,10 @@ def run_sample(args):
----------
args : argparse namespace
"""
np.random.seed(args.seed)
problem = read_param_file(args.paramfile)
param_values = sample(problem)
np.savetxt(args.result, param_values, delimiter=args.delimiter,
np.savetxt(args.output, param_values, delimiter=args.delimiter,
fmt='%.' + str(args.precision) + 'e')


Expand Down
2 changes: 1 addition & 1 deletion SALib/sample/finite_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def run_sample(args):
np.random.seed(args.seed)
problem = read_param_file(args.paramfile)
param_values = sample(problem, args.samples, args.delta)
np.savetxt(args.result, param_values, delimiter=args.delimiter,
np.savetxt(args.output, param_values, delimiter=args.delimiter,
fmt='%.' + str(args.precision) + 'e')


Expand Down
2 changes: 1 addition & 1 deletion SALib/sample/latin.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def run_sample(args):
np.random.seed(args.seed)
problem = read_param_file(args.paramfile)
param_values = sample(problem, args.samples)
np.savetxt(args.result, param_values, delimiter=args.delimiter,
np.savetxt(args.output, param_values, delimiter=args.delimiter,
fmt='%.' + str(args.precision) + 'e')


Expand Down
2 changes: 1 addition & 1 deletion SALib/sample/saltelli.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def run_sample(args):
problem = read_param_file(args.paramfile)
param_values = sample(problem, args.samples,
calc_second_order=(args.max_order == 2))
np.savetxt(args.result, param_values, delimiter=args.delimiter,
np.savetxt(args.output, param_values, delimiter=args.delimiter,
fmt='%.' + str(args.precision) + 'e')


Expand Down

0 comments on commit 75f0ebc

Please sign in to comment.