Registry / data / salib
library1.5.2pypypi✓ verified 84d ago

SALib is an open-source Python library providing implementations of various global sensitivity analysis methods, including Sobol', Morris, FAST, DGSM, PAWN, HDMR, Moment Independent, and fractional factorial. It is currently at version 1.5.2 and maintains an active development status with somewhat regular releases.

pip install SALib
INSTALL
IMPORT
SIG · SALIB
S
salib
datapythonv1.5.2
Install
16.1s avg
Import
1107ms
Disk
403MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.5.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 1.138s · 399.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 16.1s · import 1.076s · 383MB
403MB installed
● package 403MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sample_method
from SALib.sample import saltelli
Sampling methods are imported from the `SALib.sample` submodule.
analyze_method
from SALib.analyze import sobol
Analysis methods are imported from the `SALib.analyze` submodule.
ProblemSpec
from SALib import ProblemSpec
For the object-oriented interface, ProblemSpec is imported directly from the top-level `SALib` package.

This quickstart demonstrates a Sobol' sensitivity analysis using the Ishigami test function. It covers defining problem parameters, generating samples using the Saltelli sampler, evaluating a model, and analyzing the results to compute sensitivity indices.

import numpy as np from SALib.sample import saltelli from SALib.analyze import sobol from SALib.test_functions import Ishigami # 1. Define the model inputs problem = { 'num_vars': 3, 'names': ['x1', 'x2', 'x3'], 'bounds': [[-np.pi, np.pi]] * 3 } # 2. Generate samples param_values = saltelli.sample(problem, 1024) # 3. Run model (example: Ishigami function) Y = Ishigami.evaluate(param_values) # 4. Perform analysis Si = sobol.analyze(problem, Y, print_to_console=True) print(f"First-order sensitivity indices: {Si['S1']}") print(f"Total-order sensitivity indices: {Si['ST']}")
Debug
Known issues
breakingSALib version 1.2 and onwards officially dropped support for Python 2. Users must use Python 3 or later versions.
fix
Ensure your Python environment is running Python 3.x (>=3.9 recommended for 1.5.2).
affects: >=1.2
breakingStarting with SALib 1.0.0, the Python API for sampling and analysis methods expects NumPy matrices directly as input for model runs and results, rather than file paths. The command-line interface remains unchanged.
fix
Update your code to pass NumPy arrays (e.g., `param_values`, `Y`) directly to sampling and analysis functions like `saltelli.sample()` and `sobol.analyze()`.
affects: >=1.0.0
breakingSALib 1.5.2 introduced an updated NumPy dependency, requiring NumPy version 2.0 or higher.
fix
Upgrade NumPy in your environment to version 2.0 or newer using `pip install --upgrade numpy`.
affects: >=1.5.2
gotchaMismatching sampling and analysis methods can lead to incorrect sensitivity indices. For example, Sobol' analysis requires samples generated by a Sobol' sampler (like Saltelli's).
fix
Always use the appropriate sampling method for the chosen analysis method, as specified in the SALib documentation. E.g., `SALib.sample.saltelli` for `SALib.analyze.sobol`.
affects: All
gotchaSobol' index estimates can be biased if model outputs are not centered. SALib normalizes outputs by default to mitigate this. If using non-normalized outputs, larger sample sizes may be required for convergence.
fix
Be aware of the output normalization behavior if comparing results with other tools, and consider increasing sample size for non-centered outputs if normalization is bypassed or if convergence issues are observed.
affects: All
Errors
Common errors & fixes
ValueError: The number of samples in Y does not match the expected number of samples.
Y array length must exactly match the sample count from SALib.sample
fix
Ensure len(Y) == X.shape[0] where X is the sample matrix from saltelli.sample()
ImportError: cannot import name 'saltelli' from 'SALib.sample'
Old SALib version — saltelli was reorganized in SALib 1.4+
fix
pip install --upgrade salib  # saltelli is in SALib.sample since 1.4
ModuleNotFoundError: No module named 'SALib'
SALib not installed or wrong case — pip package is salib (lowercase)
fix
pip install salib
AttributeError: module 'SALib' has no attribute 'Problem'
problem is a plain dict, not a SALib class
fix
problem = {'num_vars': 3, 'names': ['x1','x2','x3'], 'bounds': [[0,1],[0,1],[0,1]]}
KeyError: 'num_vars'
num_vars key missing from problem dict
fix
Always include 'num_vars' in the problem dict
Upgrade
Version history
1.5.2latest on PyPI · released Oct 12, 2025
Audit
Dependencies
numpyrequiredCore numerical operations; requires >=2.0 since SALib 1.5.2.
scipyrequiredMathematical and scientific computations.
matplotlibrequiredPlotting and visualization of results.
pandasrequiredData structures and analysis, especially for results handling.
Agent activity
49 hits · last 30 days
node
42
Bingbot
1
OpenAI (training)
1
Resources
salib — pip install salib · libregistry