Registry / ai-ml / spotpy

spotpy

JSON →
library1.6.7pypypi✓ verified 88d ago

spotpy is a Python library for statistical parameter optimization, calibration, and sensitivity analysis of environmental models. It provides a range of algorithms including Monte Carlo, Markov chain Monte Carlo (MCMC), Shuffled Complex Evolution (SCE-UA), DREAM, and various sensitivity analysis methods like FAST and Morris. Current version: 1.6.7. Release cadence is irregular, with several minor releases in recent years.

pip install spotpy
INSTALL
IMPORT
SIG · SPOTPY
S
spotpy
ai-mlpythonv1.6.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

spotpy
✓ import spotpy
The main module is imported directly as 'spotpy'.
spotpy_setup
✓ from spotpy.examples import spotpy_setup as setup
✗ import spotpy_setup
spotpy_setup is a module inside spotpy.examples, not a top-level package.
demcz
✓ from spotpy import demcz
✗ import demcz
demcz is a submodule inside spotpy, not a standalone package.

Basic Monte Carlo sampling using spotpy with a built-in example setup (HYMOD model).

import spotpy from spotpy.examples.spotpy_setup_hymod import spotpy_setup as setup # Create a test setup spotpy_setup = setup() # Select algorithm (here: Monte Carlo) sampler = spotpy.algorithms.mc(spotpy_setup, dbname='MC_test', dbformat='csv') sampler.sample(100) # Get results results = sampler.getdata() print(results.keys())
Debug
Known issues
breakingMigration to pyproject.toml in v1.6.1 removed setup.py. Installations via 'pip install -e .' may require setuptools update or use of 'pip install -e . --no-use-pep517'.
fix
Update pip and setuptools: pip install --upgrade pip setuptools. Or use 'pip install -e . --no-use-pep517' if needed.
affects: >=1.6.1
deprecatedPython 2 support was removed in v1.6.1. Python 3.6+ is required, but the current version specifies Python >=3.10.
fix
Upgrade to Python 3.10 or higher.
affects: >=1.6.1
gotchaWhen using the DREAM algorithm, the 'random_state' parameter must be an integer for reproducible results. Passing None leads to non-reproducible chains.
fix
Set random_state to an integer, e.g., sampler = spotpy.algorithms.dream(..., random_state=42).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'spotpy_setup'
user tries to import spotpy_setup directly as a top-level module, but it is inside spotpy.examples.
fix
Use: from spotpy.examples.spotpy_setup_hymod import spotpy_setup as setup
AttributeError: module 'spotpy' has no attribute 'algorithms'
Old code that directly imports spotpy.algorithms without importing spotpy first, or incorrect import path.
fix
Import spotpy first, then use spotpy.algorithms.mc(...) or from spotpy.algorithms import mc
ValueError: Unknown database format 'csv'
Database format is case-sensitive. 'csv' is correct, but some users may accidentally use 'CSV' or 'Csv'.
fix
Use lowercase: dbformat='csv'
Upgrade
Version history
1.6.7latest on PyPI · released Feb 16, 2026
Audit
Dependencies
numpyrequiredCore dependency for numerical operations
scipyrequiredRequired for optimization and statistical functions
matplotliboptionalUsed for plotting results in tutorials and some algorithms
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
spotpy — pip install spotpy · libregistry