From 92c3aad416ccd6becbeb345c58cae36b3a63d892 Mon Sep 17 00:00:00 2001 From: thouska Date: Thu, 9 Sep 2021 14:50:44 +0200 Subject: [PATCH] Make spotpy more robust against truncation of data #269 --- spotpy/algorithms/_algorithm.py | 4 ++-- spotpy/parameter.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spotpy/algorithms/_algorithm.py b/spotpy/algorithms/_algorithm.py index 3e029785..5e59186c 100644 --- a/spotpy/algorithms/_algorithm.py +++ b/spotpy/algorithms/_algorithm.py @@ -194,7 +194,7 @@ class _algorithm(object): If the objectivefunction value is higher, the results are saved in the database. If not they are ignored (saves storage). db_precision:np.float type set np.float16, np.float32 or np.float64 for rounding of floats in the output database - Default is np.float16 + Default is np.float32 sim_timeout: float, int or None, default: None the defined model given in the spot_setup class can be controlled to break after 'sim_timeout' seconds if sim_timeout is not None. @@ -207,7 +207,7 @@ class _algorithm(object): def __init__(self, spot_setup, dbname=None, dbformat=None, dbinit=True, dbappend=False, parallel='seq', save_sim=True, breakpoint=None, - backup_every_rep=100, save_threshold=-np.inf, db_precision=np.float16, + backup_every_rep=100, save_threshold=-np.inf, db_precision=np.float32, sim_timeout=None, random_state=None, optimization_direction='grid', algorithm_name=''): # Initialize the user defined setup class diff --git a/spotpy/parameter.py b/spotpy/parameter.py index c786172c..12170ce6 100644 --- a/spotpy/parameter.py +++ b/spotpy/parameter.py @@ -679,7 +679,7 @@ def generate(parameters): is given as a structured array in the format the parameters function of a setup expects :parameters: A sequence of parameter objects """ - dtype = [('random', '