Skip to content

Commit

Permalink
Fix for #266
Browse files Browse the repository at this point in the history
pathos multiprocessing imap was resulting in broke spotpy database. Switching to map solces the issue
  • Loading branch information
thouska committed May 31, 2021
1 parent 6be2dcf commit 80435f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion spotpy/examples/spot_setup_hymod_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import numpy as np
import spotpy
import os
import multiprocessing as mp
from distutils.dir_util import copy_tree, remove_tree
#from shutil import rmtree
import sys
Expand Down
4 changes: 2 additions & 2 deletions spotpy/examples/tutorial_parallel_computing_hymod.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
sampler.sample(rep)

# Load results from file
#results = spotpy.analyser.load_csv_results('Parallel_hymod')

results = spotpy.analyser.load_csv_results('Parallel_hymod')
print(len(results))
# Plot best model run
#spotpy.analyser.plot_bestmodelrun(results,spot_setup.evaluation())
2 changes: 1 addition & 1 deletion spotpy/parallel/mproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ def f(self, job):
return data

def __call__(self, jobs):
results = self.pool.imap(self.f, jobs)
results = self.pool.map(self.f, jobs)
for i in results:
yield i

0 comments on commit 80435f9

Please sign in to comment.