Skip to content

Commit

Permalink
Merge pull request #562 from e-kwsm/docs
Browse files Browse the repository at this point in the history
fix typos, math functions, and markdown syntax
  • Loading branch information
ConnectedSystems committed Apr 3, 2023
2 parents baa394e + 80ab451 commit e5cfb66
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 37 deletions.
2 changes: 1 addition & 1 deletion CITATIONS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Software
Blogs
~~~~~

* `Sensitivity Analyis in Python <http://www.perrygeo.com/sensitivity-analysis-in-python.html>`_
* `Sensitivity Analysis in Python <http://www.perrygeo.com/sensitivity-analysis-in-python.html>`_
* `Sensitivity Analysis with SALib <http://keyboardscientist.weebly.com/blog/sensitivity-analysis-with-salib>`_
* `Running Sobol using SALib <https://waterprogramming.wordpress.com/2013/08/05/running-sobol-sensitivity-analysis-using-salib/>`_
* `Extensions of SALib for more complex sensitivity analyses <https://waterprogramming.wordpress.com/2014/02/11/extensions-of-salib-for-more-complex-sensitivity-analyses/>`_
Expand Down
50 changes: 27 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,38 @@ To contribute new code, submit a pull request. There are two instances in which

### Making a development environment

.. note::

We **strongly** recommend using a virtual environment setup, such as
``venv`` or ``conda``.
Note: We **strongly** recommend using a virtual environment setup, such as
`venv` or `conda`.

First, fork a copy of the main SALib repository in GitHub onto your own
account and then create your local repository via::
account and then create your local repository via:

git clone git@github.com:YOURUSERNAME/SALib.git
cd SALib
```sh
git clone git@github.com:YOURUSERNAME/SALib.git
cd SALib
```

Next, set up your development environment.

With ``conda`` installed (through
`Miniforge or Mambaforge <https://github.com/conda-forge/miniforge>`_,
`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ or
`Anaconda <https://www.anaconda.com/products/individual>`_), execute the
With `conda` installed (through
[Miniforge or Mambaforge](https://github.com/conda-forge/miniforge),
[Miniconda](https://docs.conda.io/en/latest/miniconda.html) or
[Anaconda](https://www.anaconda.com/products/individual)), execute the
following commands at the terminal from the base directory of your
`SALib <https://github.com/SALib/SALib>`_ clone::
[SALib](https://github.com/SALib/SALib) clone:

# Create an environment with all development dependencies
conda env create -f environment.yml # works with `mamba` too
# Activate the environment
conda activate SALib
```sh
# Create an environment with all development dependencies
conda env create -f environment.yml # works with `mamba` too
# Activate the environment
conda activate SALib
```

Finally, you can install SALib in editable mode in your environment::
Finally, you can install SALib in editable mode in your environment:

pip install -e .
```sh
pip install -e .
```

### Fixing a Bug

Expand All @@ -64,7 +68,7 @@ Then, please create a new branch with the name `bug_xxx` where xxx is the number
If possible, write a test which reproduces the bug. The tests are stored in the `SALib/tests/` folder, and are run using `pytest` from the root folder of the library.
You can run the tests with the command `pytest` from the root project directory. Individual tests can be run with by specifying a file, or file and test function.

For example::
For example:

```bash
$ pytest # run all tests
Expand Down Expand Up @@ -128,10 +132,10 @@ Thanks again!
Following is the process that the development team follows in order to make
a release:

1. Document overview of changes since last release in ``CHANGELOG.MD``
2. Update the version in the main ``__init__.py``.
3. Build locally using ``hatch build``, and verify the content of the artifacts
4. Submit PR, wait for tests to pass, and merge release into ``main``
1. Document overview of changes since last release in `CHANGELOG.MD`
2. Update the version in the main `__init__.py`.
3. Build locally using `hatch build`, and verify the content of the artifacts
4. Submit PR, wait for tests to pass, and merge release into `main`
5. Tag release with version number and push to SALib repo
6. Check that release has been deployed to PyPI
7. Check documentation is built and deployed to readthedocs (http://salib.readthedocs.org)
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Software
Blogs
~~~~~

* `Sensitivity Analyis in Python <http://www.perrygeo.com/sensitivity-analysis-in-python.html>`_
* `Sensitivity Analysis in Python <http://www.perrygeo.com/sensitivity-analysis-in-python.html>`_
* `Sensitivity Analysis with SALib <http://keyboardscientist.weebly.com/blog/sensitivity-analysis-with-salib>`_
* `Running Sobol using SALib <https://waterprogramming.wordpress.com/2013/08/05/running-sobol-sensitivity-analysis-using-salib/>`_
* `Extensions of SALib for more complex sensitivity analyses <https://waterprogramming.wordpress.com/2014/02/11/extensions-of-salib-for-more-complex-sensitivity-analyses/>`_
Expand Down
4 changes: 2 additions & 2 deletions docs/user_guide/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ analysis methods because it exhibits strong nonlinearity and nonmonotonicity.

.. math::
f(x) = sin(x_1) + a sin^2(x_2) + b x_3^4 sin(x_1)
f(x) = \sin(x_1) + a \sin^2(x_2) + b x_3^4 \sin(x_1)
Importing SALib
~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -333,7 +333,7 @@ Now we can extract the first-order Sobol indices for each bin of :math:`x` and p
:width: 800
:align: center

With the help of the plots, we interprete the Sobol indices. At
With the help of the plots, we interpret the Sobol indices. At
:math:`x=0`, the variation in :math:`y` can be explained to 100 % by
parameter :math:`a` as the contribution to :math:`y` from :math:`b
x^2` vanishes. With larger :math:`|x|`, the contribution to the
Expand Down
4 changes: 2 additions & 2 deletions docs/user_guide/basics_with_interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function, shown below.

.. math::
f(x) = sin(x_1) + a sin^2(x_2) + b x_3^4 sin(x_1)
f(x) = \sin(x_1) + a \sin^2(x_2) + b x_3^4 \sin(x_1)
The ProblemSpec Interface
Expand Down Expand Up @@ -551,7 +551,7 @@ Now we can extract the first-order Sobol indices for each bin of :math:`x` and p
:align: center


With the help of the plots, we interprete the Sobol indices. At
With the help of the plots, we interpret the Sobol indices. At
:math:`x=0`, the variation in :math:`y` can be explained to 100 % by
parameter :math:`a` as the contribution to :math:`y` from :math:`b
x^2` vanishes. With larger :math:`|x|`, the contribution to the
Expand Down
8 changes: 4 additions & 4 deletions src/SALib/analyze/hdmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def analyze(
settings = _check_settings(X, Y, maxorder, maxiter, m, K, R, alpha, lambdax)
init_vars = _init(X, Y, settings)

# Sensitivity Analysis Computation with/without bootstraping
# Sensitivity Analysis Computation with/without bootstrapping
SA, Em, RT, Y_em, idx = _compute(X, Y, settings, init_vars)

# Finalize results
Expand Down Expand Up @@ -228,7 +228,7 @@ def _check_settings(X, Y, maxorder, maxiter, m, K, R, alpha, lambdax):
# Important next check for maxorder - as maxorder relates to d
if (d == 2) and (maxorder > 2):
raise RuntimeError(
'SALib-HDMR ERRROR: Field "maxorder" of options has to be 2 as'
'SALib-HDMR ERROR: Field "maxorder" of options has to be 2 as'
" d = 2 (X has two columns)"
)

Expand Down Expand Up @@ -373,7 +373,7 @@ def _init(X, Y, settings):
# No Bootstrap
idx = np.arange(0, N).reshape(N, 1)
else:
# Now setup the boostrap matrix with selection matrix, idx, for samples
# Now setup the bootstrap matrix with selection matrix, idx, for samples
idx = np.argsort(np.random.rand(N, K), axis=0)[:R]

# Compute normalized X-values
Expand All @@ -397,7 +397,7 @@ def _init(X, Y, settings):
c3 = np.asarray(list(itertools.combinations(np.arange(0, d), 3)))
n3 = c3.shape[0]

# calulate total number of coefficients
# calculate total number of coefficients
n = n1 + n2 + n3

# Initialize m1, m2 and m3 - number of coefficients first, second, third
Expand Down
2 changes: 1 addition & 1 deletion src/SALib/analyze/rbd_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def compute_first_order(permuted_outputs, M):

def unskew_S1(S1, M, N):
"""
Unskew the sensivity indice
Unskew the sensitivity indices
(Jean-Yves Tissot, Clémentine Prieur (2012) "Bias correction for the
estimation of sensitivity indices based on random balance designs.",
Reliability Engineering and System Safety, Elsevier, 107, 205-213.
Expand Down
2 changes: 1 addition & 1 deletion src/SALib/plotting/hdmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@author: @sahin-abdullah
This submodule produces two diffent figures: (1) emulator vs simulator,
This submodule produces two different figures: (1) emulator vs simulator,
(2) regression lines of first order component functions
"""
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion src/SALib/sample/morris/morris.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def _generate_trajectory(
# Matrix J - a (g+1)-by-num_params matrix of ones
J = np.ones((num_groups + 1, num_params))

# Matrix D* - num_params-by-num_params matrix which decribes whether
# Matrix D* - num_params-by-num_params matrix which describes whether
# factors move up or down
D_star = np.diag(rd.choice([-1, 1], num_params))

Expand Down
2 changes: 1 addition & 1 deletion src/SALib/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _nonuniform_scale_samples(params, bounds, dists):
)

# lognormal distribution (ln-space, not base-10)
# paramters are ln-space mean and standard deviation
# parameters are ln-space mean and standard deviation
elif dists[i] == "lognorm":
# checking for valid parameters
if b2 <= 0:
Expand Down

0 comments on commit e5cfb66

Please sign in to comment.