Skip to content

Commit

Permalink
Changed test scripts to use older -o cli option
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnectedSystems committed Nov 25, 2018
1 parent 875e3cd commit c9f6f71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Parameter files can also be comma-delimited if your parameter names or group nam
python -m SALib.sample.saltelli \
-n 1000 \
-p ./SALib/test_functions/params/Ishigami.txt \
-r model_input.txt \
-o model_input.txt \
```

**Run the model** this will usually be a user-defined model, maybe even in another language. Just save the outputs.
Expand Down
16 changes: 8 additions & 8 deletions tests/test_cli_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def test_delta():
cmd = "python {cli} sample saltelli -p {fn} -r model_input.txt -n 1000"\
cmd = "python {cli} sample saltelli -p {fn} -o model_input.txt -n 1000"\
.format(cli=salib_cli, fn=ishigami_fp) +\
" --precision 8 --max-order 2 --seed=100"
subprocess.run(cmd.split())
Expand All @@ -36,7 +36,7 @@ def test_delta():

def test_dgsm():
# Generate inputs
cmd = "python {cli} sample finite_diff -p {fn} -r model_input.txt -d 0.001\
cmd = "python {cli} sample finite_diff -p {fn} -o model_input.txt -d 0.001\
--precision=8 -n 1000 --seed=100".format(cli=salib_cli,
fn=ishigami_fp).split()
subprocess.run(cmd)
Expand All @@ -62,7 +62,7 @@ def test_dgsm():

def test_fast():
# Generate inputs
cmd = "python {cli} sample fast_sampler -p {fn} -r model_input.txt \
cmd = "python {cli} sample fast_sampler -p {fn} -o model_input.txt \
--precision=8 -n 1000 -M 4 --seed=100".format(cli=salib_cli,
fn=ishigami_fp).split()
subprocess.run(cmd)
Expand All @@ -88,7 +88,7 @@ def test_fast():

def test_ff():
# Generate inputs
cmd = "python {cli} sample ff -p {fn} -r model_input.txt \
cmd = "python {cli} sample ff -p {fn} -o model_input.txt \
--precision=8 -n 1000 --seed=100".format(cli=salib_cli,
fn=ishigami_fp).split()
subprocess.run(cmd)
Expand All @@ -115,8 +115,8 @@ def test_ff():
def test_morris():

# Generate inputs
cmd = "python {cli} sample morris -p {fn} -r model_input.txt -n 100\
--precision=8 --levels=10 --seed=100 -o False"\
cmd = "python {cli} sample morris -p {fn} -o model_input.txt -n 100\
--precision=8 --levels=10 --seed=100 -lo False"\
.format(cli=salib_cli, fn=ishigami_fp).split()

subprocess.run(cmd)
Expand All @@ -142,7 +142,7 @@ def test_morris():

def test_rbd_fast():
# Generate inputs
cmd = "python {cli} sample ff -p {fn} -r model_input.txt \
cmd = "python {cli} sample ff -p {fn} -o model_input.txt \
--precision=8 --seed=100".format(cli=salib_cli, fn=ishigami_fp).split()

subprocess.run(cmd)
Expand All @@ -168,7 +168,7 @@ def test_rbd_fast():

def test_sobol():
# Generate inputs
cmd = "python {cli} sample saltelli -p {fn} -r model_input.txt -n 1000\
cmd = "python {cli} sample saltelli -p {fn} -o model_input.txt -n 1000\
--precision 8 --max-order 2 --seed=100".format(cli=salib_cli,
fn=ishigami_fp)
cmd = cmd.split()
Expand Down
10 changes: 5 additions & 5 deletions tests/test_cli_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_cli_entry():


def test_ff():
cmd = "python {cli} sample ff -p {fn} -r {test_data} -n 100".format(
cmd = "python {cli} sample ff -p {fn} -o {test_data} -n 100".format(
cli=salib_cli,
fn=ishigami_fp,
test_data=test_data).split()
Expand All @@ -22,7 +22,7 @@ def test_ff():


def test_fast():
cmd = "python {cli} sample fast_sampler -p {fn} -r {test_data} -n 100".format(
cmd = "python {cli} sample fast_sampler -p {fn} -o {test_data} -n 100".format(
cli=salib_cli,
fn=ishigami_fp,
test_data=test_data).split()
Expand All @@ -31,7 +31,7 @@ def test_fast():


def test_finite_diff():
cmd = "python {cli} sample finite_diff -p {fn} -r {test_data} -n 100".format(
cmd = "python {cli} sample finite_diff -p {fn} -o {test_data} -n 100".format(
cli=salib_cli,
fn=ishigami_fp,
test_data=test_data).split()
Expand All @@ -40,7 +40,7 @@ def test_finite_diff():


def test_latin():
cmd = "python {cli} sample latin -p {fn} -r {test_data} -n 100".format(
cmd = "python {cli} sample latin -p {fn} -o {test_data} -n 100".format(
cli=salib_cli,
fn=ishigami_fp,
test_data=test_data).split()
Expand All @@ -49,7 +49,7 @@ def test_latin():


def test_saltelli():
cmd = "python {cli} sample latin -p {fn} -r {test_data} -n 100".format(
cmd = "python {cli} sample latin -p {fn} -o {test_data} -n 100".format(
cli=salib_cli,
fn=ishigami_fp,
test_data=test_data).split()
Expand Down

0 comments on commit c9f6f71

Please sign in to comment.