diff --git a/mozaik/controller.py b/mozaik/controller.py index 522337d50..8bd5743c5 100644 --- a/mozaik/controller.py +++ b/mozaik/controller.py @@ -156,7 +156,7 @@ def prepare_workflow(simulation_name, model_class): } save_json(sim_info, Global.root_directory + 'sim_info.json') save_json(parameters.to_dict(), Global.root_directory + 'parameters.json') - #save_json(modified_parameters, Global.root_directory + 'modified_parameters.json') + save_json(modified_parameters, Global.root_directory + 'modified_parameters.json') recorders = get_recorders(parameters.to_dict()) save_json(recorders, Global.root_directory + 'recorders.json') diff --git a/mozaik/meta_workflow/parameter_search.py b/mozaik/meta_workflow/parameter_search.py index 67dfbbd8b..56ce9eee4 100644 --- a/mozaik/meta_workflow/parameter_search.py +++ b/mozaik/meta_workflow/parameter_search.py @@ -7,6 +7,8 @@ import re from mozaik.cli import parse_parameter_search_args from mozaik.tools.misc import result_directory_name +import json +from mozaik.tools.json_export import save_json class ParameterSearchBackend(object): """ @@ -183,10 +185,7 @@ def run_parameter_search(self): counter=0 combinations = self.generate_parameter_combinations() - - f = open(mdn + '/parameter_combinations','wb') - pickle.dump(combinations,f) - f.close() + save_json(mdn + '/parameter_combinations.json') for combination in combinations: combination['results_dir']='\"\'' + os.getcwd() + '/' + mdn + '/\'\"' @@ -250,9 +249,7 @@ def parameter_search_run_script_distributed_slurm(simulation_name,master_results core_number : int How many cores to reserve per process. """ - f = open(master_results_dir+'/parameter_combinations','rb') - combinations = pickle.load(f) - f.close() + combinations = json.load(master_results_dir + '/parameter_combinations.json') # first check whether all parameter combinations contain the same parameter names assert len(set([tuple(set(comb.keys())) for comb in combinations])) == 1 , "The parameter search didn't occur over a fixed set of parameters" @@ -295,9 +292,7 @@ def parameter_search_run_script_distributed_slurm_IoV(simulation_name,master_res core_number : int How many cores to reserve per process. """ - f = open(master_results_dir+'/parameter_combinations','rb') - combinations = pickle.load(f) - f.close() + combinations = json.load(master_results_dir + '/parameter_combinations.json') # first check whether all parameter combinations contain the same parameter names assert len(set([tuple(set(comb.keys())) for comb in combinations])) == 1 , "The parameter search didn't occur over a fixed set of parameters"