diff --git a/spotpy/algorithms/dream.py b/spotpy/algorithms/dream.py index 5433216a..1cfbc7d5 100644 --- a/spotpy/algorithms/dream.py +++ b/spotpy/algorithms/dream.py @@ -240,7 +240,7 @@ def get_r_hat(self, parameter_array): # MR_stat = np.sqrt((n + 1) / n * R + (d - 1) / d) return R_stat#[R_stat, MR_stat] - def sample(self, repetitions,nChains=5, nCr=3, delta=3, c=0.1, eps=10e-6, convergence_limit=1.2, runs_after_convergence=100,acceptance_test_option=6): + def sample(self, repetitions,nChains=7, nCr=3, delta=3, c=0.1, eps=10e-6, convergence_limit=1.2, runs_after_convergence=100,acceptance_test_option=6): self.set_repetiton(repetitions) print('Starting the DREAM algotrithm with '+str(repetitions)+ ' repetitions...') if nChains <2*delta+1: diff --git a/spotpy/analyser.py b/spotpy/analyser.py index aedafdfc..e6c83687 100644 --- a/spotpy/analyser.py +++ b/spotpy/analyser.py @@ -557,7 +557,7 @@ def plot_heatmap_griewank(results,algorithms, fig_name='heatmap_griewank.png'): cmap = plt.get_cmap('autumn') - rows=2.0 + rows=2 for i in range(subplots): amount_row = int(np.ceil(subplots/rows)) ax = plt.subplot(rows, amount_row, i+1) diff --git a/tests/test_analyser.py b/tests/test_analyser.py index 7f0e7d26..8f106dab 100644 --- a/tests/test_analyser.py +++ b/tests/test_analyser.py @@ -168,7 +168,7 @@ def test_plot_Geweke(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_get_sensitivity_of_fast(self): @@ -210,7 +210,7 @@ def test_plot_parameter_uncertainty(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_fast_sensitivity(self): @@ -220,7 +220,7 @@ def test_plot_fast_sensitivity(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_heatmap_griewank(self): spotpy.analyser.plot_heatmap_griewank([self.griewank_results],["test"], @@ -229,7 +229,7 @@ def test_plot_heatmap_griewank(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_objectivefunction(self): @@ -240,7 +240,7 @@ def test_plot_objectivefunction(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_parametertrace_algorithms(self): spotpy.analyser.plot_parametertrace_algorithms([self.griewank_results], @@ -250,7 +250,7 @@ def test_plot_parametertrace_algorithms(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) os.remove(self.fig_name) def test_plot_parametertrace(self): @@ -259,7 +259,7 @@ def test_plot_parametertrace(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_posterior_parametertrace(self): spotpy.analyser.plot_posterior_parametertrace(self.griewank_results, ["0","1"], fig_name=self.fig_name) @@ -267,7 +267,7 @@ def test_plot_posterior_parametertrace(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_posterior(self): @@ -278,7 +278,7 @@ def test_plot_posterior(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_bestmodelrun(self): spotpy.analyser.plot_bestmodelrun(self.griewank_results, @@ -287,7 +287,7 @@ def test_plot_bestmodelrun(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) os.remove(self.fig_name) def test_plot_bestmodelruns(self): @@ -300,7 +300,7 @@ def test_plot_bestmodelruns(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_objectivefunctiontraces(self): spotpy.analyser.plot_objectivefunctiontraces([self.results], @@ -310,7 +310,7 @@ def test_plot_objectivefunctiontraces(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6820) def test_plot_regression(self): spotpy.analyser.plot_regression(self.results, rosenbrock_setup().evaluation(), @@ -319,7 +319,7 @@ def test_plot_regression(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_parameterInteraction(self): # Test only untder Python 3.6 as lower versions results in a strange ValueError @@ -330,7 +330,7 @@ def test_plot_parameterInteraction(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_allmodelruns(self): @@ -349,7 +349,7 @@ def test_plot_allmodelruns(self): # approximately 8855 KB is the size of an empty matplotlib.pyplot.plot, so # we expecting a plot with some content without testing the structure of the plot, just # the size - self.assertGreaterEqual(os.path.getsize(self.fig_name), 8855) + self.assertGreaterEqual(os.path.getsize(self.fig_name), 6855) def test_plot_gelman_rubin(self): diff --git a/tests/test_gui_mpl.py b/tests/test_gui_mpl.py index 8889f953..a9c4ebd6 100644 --- a/tests/test_gui_mpl.py +++ b/tests/test_gui_mpl.py @@ -21,7 +21,7 @@ import spotpy from spotpy.gui.mpl import GUI - from .test_setup_parameters import SpotSetupMixedParameterFunction as Setup + from test_setup_parameters import SpotSetupMixedParameterFunction as Setup class TestGuiMpl(unittest.TestCase): diff --git a/tests/test_parameter.py b/tests/test_parameter.py index a229c1e2..632d62a3 100644 --- a/tests/test_parameter.py +++ b/tests/test_parameter.py @@ -16,10 +16,7 @@ # Import inspect to scan spotpy.parameter for all Parameter classes import inspect -if sys.version_info[0] >= 3: - from .testutils import repeat -else: - from testutils import repeat +from testutils import repeat # https://docs.python.org/3/library/unittest.html