Skip to content

Commit

Permalink
Merge pull request SALib#446 from schmitts/sample_with_power_of_two
Browse files Browse the repository at this point in the history
Sample with power of two to avoid warning
  • Loading branch information
ConnectedSystems committed Jul 8, 2021
2 parents 9fba0aa + d4e1dee commit 4012c13
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Parameter files can also be comma-delimited if your parameter names or group nam
**Generate samples** (the `-p` flag is the parameter file)
```
salib sample saltelli \
-n 1000 \
-n 1024 \
-p ./src/SALib/test_functions/params/Ishigami.txt \
-o model_input.txt
```
Expand Down Expand Up @@ -68,7 +68,7 @@ problem = {
`groups` is a list of strings specifying the group name to which each variable belongs. The rest of the code stays the same:

```python
param_values = saltelli.sample(problem, 1000)
param_values = saltelli.sample(problem, 1024)
Y = Ishigami.evaluate(param_values)
Si = sobol.analyze(problem, Y, print_to_console=True)
```
Expand Down Expand Up @@ -109,7 +109,7 @@ problem = {
[-3.14159265359, 3.14159265359]]
}

param_values = saltelli.sample(problem, 1000)
param_values = saltelli.sample(problem, 1024)
```

SALib is also capable of generating alternate sampling distributions by
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Procedural approach
}
# Generate samples
param_values = saltelli.sample(problem, 1000)
param_values = saltelli.sample(problem, 1024)
# Run model (example)
Y = Ishigami.evaluate(param_values)
Expand Down Expand Up @@ -128,7 +128,7 @@ Chaining calls is supported from SALib v1.4
'outputs': ['Y'] # name of outputs in expected order
})
(sp.sample_saltelli(1000, calc_second_order=True)
(sp.sample_saltelli(1024, calc_second_order=True)
.evaluate(Ishigami.evaluate)
.analyze_sobol(print_to_console=True))
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Or in the `problem` dictionary:

.. code:: python
param_values = saltelli.sample(problem, 1000)
param_values = saltelli.sample(problem, 1024)
Y = Ishigami.evaluate(param_values)
Si = sobol.analyze(problem, Y, print_to_console=True)
Expand Down Expand Up @@ -69,7 +69,7 @@ In :ref:`basics`, we generate a uniform sample of parameter space.
[-3.14159265359, 3.14159265359]]
}
param_values = saltelli.sample(problem, 1000)
param_values = saltelli.sample(problem, 1024)
SALib is also capable of generating alternate sampling distributions by
specifying a :code:`dists` entry in the :code:`problem` specification.
Expand Down
4 changes: 2 additions & 2 deletions docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ below.

.. code:: python
param_values = saltelli.sample(problem, 1000)
param_values = saltelli.sample(problem, 1024)
Here, :code:`param_values` is a NumPy matrix. If we run
:code:`param_values.shape`, we see that the matrix is 8000 by 3. The Saltelli
sampler generated 8000 samples. The Saltelli sampler generates
:math:`N*(2D+2)` samples, where in this example N is 1000 (the argument we
:math:`N*(2D+2)` samples, where in this example N is 1024 (the argument we
supplied) and D is 3 (the number of model inputs). The keyword argument :code:`calc_second_order=False` will exclude second-order indices, resulting in a smaller sample matrix with :math:`N*(D+2)` rows instead.

Run Model
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ and copy/paste the code below.
}
# Generate samples
param_values = saltelli.sample(problem, 1000)
param_values = saltelli.sample(problem, 1024)
# Run model (example)
Y = Ishigami.evaluate(param_values)
Expand Down

0 comments on commit 4012c13

Please sign in to comment.