From dae6c696b69f795c8c1f44fb2a1eaa10eac8a1e4 Mon Sep 17 00:00:00 2001 From: lu-kas <> Date: Tue, 22 Sep 2020 13:08:47 +0200 Subject: [PATCH] add params_min/max into break point pickle --- spotpy/algorithms/_algorithm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spotpy/algorithms/_algorithm.py b/spotpy/algorithms/_algorithm.py index 1a2fc94c..c92f0d78 100644 --- a/spotpy/algorithms/_algorithm.py +++ b/spotpy/algorithms/_algorithm.py @@ -366,17 +366,19 @@ def read_breakdata(self, dbname): Reason: In case of incomplete optimizations, old data can be restored. ''' import pickle with open(dbname+'.break', 'rb') as breakfile: - work,backuptime,repos,obmin,obmax=pickle.load(breakfile) + work,backuptime,repos,obmin,obmax,pmin,pmax=pickle.load(breakfile) self.status.starttime=self.status.starttime-backuptime self.status.rep=repos self.status.objectivefunction_min=obmin self.status.objectivefunction_max=obmax + self.status.params_min=pmin + self.status.params_max=pmax return work def write_breakdata(self, dbname, work): ''' Write data to a pickle file if a breakpoint has been set.''' import pickle - work=(work,self.status.last_print-self.status.starttime,self.status.rep,self.status.objectivefunction_min,self.status.objectivefunction_max) + work=(work,self.status.last_print-self.status.starttime,self.status.rep,self.status.objectivefunction_min,self.status.objectivefunction_max,self.status.params_min,self.status.params_max) with open(str(dbname)+'.break', 'wb') as breakfile: pickle.dump(work, breakfile)