Skip to content

Commit

Permalink
Merge pull request #330 from Herzog-A/pr-316
Browse files Browse the repository at this point in the history
Pr 316
  • Loading branch information
thouska authored Feb 12, 2025
2 parents 7e5e3f4 + ca74a0d commit 20653ba
Show file tree
Hide file tree
Showing 13 changed files with 857 additions and 598 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9

- name: Install dependencies
run: |
Expand All @@ -48,15 +48,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -77,7 +77,7 @@ jobs:
run: |
python -m build
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
with:
path: dist
Expand All @@ -87,11 +87,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- name: Publish to Test PyPI
# only if working on master
if: github.ref == 'refs/heads/master'
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Some features you can use with the SPOTPY package are:
* Differential Evolution Adaptive Metropolis Algorithm (`DREAM`)
* RObust Parameter Estimation (`ROPE`)
* Fourier Amplitude Sensitivity Test (`FAST`)
* extended Fourier Amplitude Sensitivity Test (`eFAST`)
* Artificial Bee Colony (`ABC`)
* Fitness Scaled Chaotic Artificial Bee Colony (`FSCABC`)
* Dynamically Dimensioned Search algorithm (`DDS`)
Expand Down
21 changes: 16 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Simulated Annealing (`SA`), Shuffled Complex Evolution Algorithm (`SCE-UA`),
Differential Evolution Adaptive Metropolis Algorithm (`DE-MCz`),
RObust Parameter Estimation (`ROPE`), Artificial Bee Colony (`ABC`),
Dynamicallly Dimensioned Search algorithm (`DDS`), Pareto Archived Dynamicallly Dimensioned Search algorithm (`PA-DDS`)
Fitness Scaled Chaotic Artificial Bee Colony (`FSCABC`) and Fourier Amplitude Sensitivity Test (`FAST`).
Fitness Scaled Chaotic Artificial Bee Colony (`FSCABC`), Fourier Amplitude Sensitivity Test (`FAST`) and extended Fourier Amplitude Sensitivity Test (`eFAST`).

* Wide range of objective functions, likelihood functions and hydroligcal signatures to validate the sampled results.
Available objective functions are:
Expand Down Expand Up @@ -153,6 +153,7 @@ The results can be analysed with some pre-build statistics and plotting features
sa.py # Simulated annealing
rope.py # RObust Parameter Estimation
fast.py # Fourier Amplitude Sensitivity Testing
efast.py # extended Fourier Amplitude Sensitivity Testing
abc.py # Artificial Bee Colony
fscabc.py # Fitness Scaled Chaotic Artificial Bee Colony
dream.py # Differential Evolution Adaptive Metropolis
Expand All @@ -172,7 +173,17 @@ The results can be analysed with some pre-build statistics and plotting features
getting_started.py # Recommended test file for starters

tutorials/
tutorial_rosenbrock.py # Source code for the Rosenbrock example the Tutorial
tutorial_griewank.py # Source code for the Rosenbrock example the Tutorial
tutorial_ackley.py # Source code for the Rosenbrock example the Tutorial
tutorial_Parameterlist_iterator.py # Example how to sample given parameter combinations
tutorial_rosenbrock.py # Source code for the Rosenbrock example the Tutorial
tutorial_griewank.py # Source code for the Griewank example the Tutorial
tutorial_ackley.py # Source code for the Ackley example the Tutorial
tutorial_Parameterlist_iterator.py # Example how to sample given parameter combinations
tutorial_own_database.py # Example how to implement your own database
tutorial_parallel_computing_hymod.py # Example how to set up spotpy on a cluster computer
tutorial_signatures.py # Example on usage on hydrological signatures
tutorial_nsgaii.py # Example on how to use the nsgaii algorithm
tutorial_padds_hymod.py # Example on how to use the padds algorithm
tutorial_dds_hymod.py # Example on how to use the dds algorithm
tutorial_sceua_hymod.py # Example on how to use the sceua algorithm
tutorial_fast_hymod.py # Example on how to use the fast algorithm
tutorial_efast_hymod.py # Example on how to use the efast algorithm
tutorial_dream_hymod.py # Example on how to use the dream algorithm
1 change: 1 addition & 0 deletions src/spotpy/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .dds import dds # Dynamically Dimensioned Search algorithm
from .demcz import demcz # Differential Evolution Markov Chain
from .dream import dream # DiffeRential Evolution Adaptive Metropolis
from .efast import efast # eFAST algorithm adapted from FAST R package
from .fast import fast # Fourier Amplitude Sensitivity Test
from .fscabc import fscabc # Fitness Scaling Artificial Bee Colony
from .lhs import lhs # Latin Hypercube Sampling
Expand Down
14 changes: 7 additions & 7 deletions src/spotpy/algorithms/demcz.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def __init__(self, maxChainDraws, nChains, dimensions):
self._logPSequences = np.zeros((nChains, maxChainDraws))
self._logPHistory = np.zeros(nChains * maxChainDraws)
self.r_hat = [] * dimensions
self._sampling_start = np.Inf
self._sampling_start = np.inf

self._nChains = nChains
self._dimensions = dimensions
Expand Down Expand Up @@ -483,7 +483,7 @@ def samples(self):
return self.group_samples("all")

def group_samples(self, name):
if self._sampling_start < np.Inf:
if self._sampling_start < np.inf:
start = int(
max(np.ceil(self.relevantHistoryStart), self._sampling_start)
* self._nChains
Expand Down Expand Up @@ -627,11 +627,11 @@ class _GRConvergence:
"""

def __init__(self):
self._W = np.Inf
self._R = np.Inf
self._V = np.Inf
self._VChange = np.Inf
self._WChange = np.Inf
self._W = np.inf
self._R = np.inf
self._V = np.inf
self._VChange = np.inf
self._WChange = np.inf

def _get_R(self):
return self._R
Expand Down
Loading

0 comments on commit 20653ba

Please sign in to comment.