Skip to content
Snippets Groups Projects
Commit e41548b1 authored by Martin Bauer's avatar Martin Bauer
Browse files

Parameter study: faster filtering of already simulated scenarios

parent 91ea97da
No related merge requests found
......@@ -324,7 +324,8 @@ class ParameterStudy:
def _filter_already_simulated(self, all_runs):
"""Removes all runs from the given list, that are already in the database"""
return [r for r in all_runs if not self.db.was_already_simulated(r.parameter_dict)]
already_simulated = {json.dumps(e.params) for e in self.db.filter({})}
return [r for r in all_runs if json.dumps(r.parameter_dict) not in already_simulated]
@staticmethod
def _distribute_runs(all_runs, process, num_processes):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment