Commit 6e3cd67c authored by Dumoulin Nicolas's avatar Dumoulin Nicolas
Browse files

output data enhancement

parent e73b9bf3
......@@ -86,7 +86,7 @@ class MCMC:
self.rng = np.random.RandomState(42)
print('MCMC initialized with default seed') # self.rng.get_state()
# Copying input data in output dir
self.outputdir = self.mcmc_config['output_dir'] + '/' + time.strftime('%Y%m%d-%H%M%S') + '/'
self.outputdir = self.mcmc_config['output_dir'] + '/' + time.strftime('%Y%m%d-%H%M%S')
if not os.path.exists(self.outputdir):
os.makedirs(self.outputdir)
print('All data will be written in {}'.format(self.outputdir))
......@@ -103,8 +103,13 @@ class MCMC:
shutil.copy(f, self.outputdir)
with open(self.outputdir+'/seed.txt', 'w') as outfile:
outfile.write('{}\n'.format(self.rng.get_state()))
config_data = {
'patches_md5sum':self.patches_md5sum,
'biodiversity_matrix_md5sum':md5sum(self.mcmc_config['indicators_config']['biodiversity']['matrixfilename']),
'social_patches_costs_md5sum':md5sum(self.mcmc_config['indicators_config']['social']['patches_costs_filename'])
}
with open(self.outputdir+'/config.yml', 'w') as outfile:
yaml.dump({'patches_md5sum':self.patches_md5sum}, outfile, default_flow_style=False)
yaml.dump(config_data, outfile, default_flow_style=False)
# finishing init
self.patches = load_pat_patches(self.mcmc_config['patches'])
self.target = pd.read_csv(self.mcmc_config['target'], sep=';',index_col=0)
......
Markdown is supported
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