Skip to content

Commit

Permalink
Merge branch 'master' into PADDS
Browse files Browse the repository at this point in the history
* master:
  Update version number
  Add database folder to installation routine thouska#208
  Fix parameter trace plotting
  Bugfix for restart function

# Conflicts:
#	spotpy/__init__.py
  • Loading branch information
bees4ever committed Mar 26, 2019
2 parents 67db102 + bd8ce10 commit 5fc712b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__/
*.out
*.in
*.png
*.csv
site/*
mkdocs.yml

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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': ['*'],
Expand Down
2 changes: 1 addition & 1 deletion spotpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
from . import unittests
__version__ = '1.4.5'
__version__ = '1.4.6'
4 changes: 2 additions & 2 deletions spotpy/algorithms/fscabc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
14 changes: 6 additions & 8 deletions spotpy/analyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -627,22 +625,22 @@ 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])
if j==0:
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')


Expand Down

0 comments on commit 5fc712b

Please sign in to comment.