From 0c78800609bb4439ff9e880b47140928124c149e Mon Sep 17 00:00:00 2001 From: Patrick Lauer Date: Thu, 7 Mar 2019 11:22:20 +0100 Subject: [PATCH 1/4] Bugfix for restart function --- spotpy/algorithms/fscabc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotpy/algorithms/fscabc.py b/spotpy/algorithms/fscabc.py index 8ec8dce7..19f48dc6 100644 --- a/spotpy/algorithms/fscabc.py +++ b/spotpy/algorithms/fscabc.py @@ -239,8 +239,8 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=F if self.breakpoint == 'write' or self.breakpoint == 'readandwrite'\ and icall >= lastbackup+self.backup_every_rep: - work = (icall, work, gnrng, r) - self.write_breakdata(self.dbname, work) + savework = (icall, work, gnrng, r) + self.write_breakdata(self.dbname, savework) lastbackup = icall if icall >= repetitions: print('*** OPTIMIZATION SEARCH TERMINATED BECAUSE THE LIMIT') From 5d442bf10143703339358dce61f3bb67e155eb31 Mon Sep 17 00:00:00 2001 From: thouska Date: Fri, 22 Mar 2019 10:13:25 +0100 Subject: [PATCH 2/4] Fix parameter trace plotting --- .gitignore | 1 + spotpy/analyser.py | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index f8e8ac69..ee4e359b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ *.out *.in *.png +*.csv site/* mkdocs.yml diff --git a/spotpy/analyser.py b/spotpy/analyser.py index cbe09941..ab0c2713 100644 --- a/spotpy/analyser.py +++ b/spotpy/analyser.py @@ -598,17 +598,15 @@ def plot_objectivefunction(results,evaluation,limit=None,sort=True): else: plt.plot(bestlike) -def plot_parametertrace_algorithms(results,algorithmnames=None,parameternames=None,xticks=[0,2000,4000]): +def plot_parametertrace_algorithms(results,algorithmnames=None,parameternames=None): """Example Plot as seen in the SPOTPY Documentation""" import matplotlib.pyplot as plt from matplotlib import colors - cnames=list(colors.cnames) font = {'family' : 'calibri', 'weight' : 'normal', 'size' : 20} plt.rc('font', **font) fig=plt.figure(figsize=(17,5)) - rep=len(results[0]) subplots=len(results) rows=2 for j in range(rows): @@ -627,13 +625,11 @@ def plot_parametertrace_algorithms(results,algorithmnames=None,parameternames=No ax.set_xlabel(algorithmnames[i-subplots]) ax.plot(data,'b-') - ax.plot([1]*rep,'r--') - ax.set_xlim(0,rep) ax.set_ylim(-50,50) - ax.xaxis.set_ticks(xticks) if i==0 and j==0: ax.set_ylabel('x') ax.yaxis.set_ticks([-50,0,50]) + rep = len(data) if i==0 and j==1: ax.set_ylabel('y') ax.yaxis.set_ticks([-50,0,50]) @@ -641,8 +637,10 @@ def plot_parametertrace_algorithms(results,algorithmnames=None,parameternames=No ax.xaxis.set_ticks([]) if i>0: ax.yaxis.set_ticks([]) - - plt.tight_layout() + ax.plot([1]*rep,'r--') + ax.set_xlim(0,rep) + + #plt.tight_layout() fig.savefig('test2.png', bbox_inches='tight') From be580441309debaf5bb8d7f20dc65ac70debe653 Mon Sep 17 00:00:00 2001 From: thouska Date: Fri, 22 Mar 2019 10:16:02 +0100 Subject: [PATCH 3/4] Add database folder to installation routine #208 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 82129ff7..64c1d5bd 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ url = 'http://www.uni-giessen.de/cms/faculties/f09/institutes/ilr/hydro/download/spotpy', license = 'MIT', packages = ["spotpy", "spotpy.examples", "spotpy.examples.hymod_python", "spotpy.examples.hymod_exe", - "spotpy.examples.cmf_data", "spotpy.algorithms", "spotpy.parallel", "spotpy.gui", "spotpy.hydrology"], + "spotpy.examples.cmf_data", "spotpy.algorithms", "spotpy.parallel", "spotpy.gui", "spotpy.hydrology", + "spotpy.database"], package_data={ 'spotpy.examples.hymod_exe': ['*'], 'spotpy.examples.hymod_python': ['*'], From bd8ce1006dabf7bead061c60d74a8ea246cb5778 Mon Sep 17 00:00:00 2001 From: thouska Date: Fri, 22 Mar 2019 10:20:52 +0100 Subject: [PATCH 4/4] Update version number --- setup.py | 2 +- spotpy/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 64c1d5bd..caecfd92 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name = 'spotpy', - version = '1.4.5', + version = '1.4.6', description = 'A Statistical Parameter Optimization Tool', long_description=open(os.path.join(os.path.dirname(__file__), "README.rst")).read(), diff --git a/spotpy/__init__.py b/spotpy/__init__.py index 98eb08b5..7a298068 100644 --- a/spotpy/__init__.py +++ b/spotpy/__init__.py @@ -39,4 +39,4 @@ from . import describe # Contains some helper functions to describe smaplers and setups from .hydrology import signatures # Quantifies goodness of fit between simulation and evaluation data with hydrological signatures -__version__ = '1.4.5' \ No newline at end of file +__version__ = '1.4.6' \ No newline at end of file