Closed mjmroz closed 2 years ago
I would change option name: "results"
-> "yaml output"
(i.e., more specific). Current approach allows sending the yaml output to standard output, which for me doesn't make much sense. Current version is OK and only some minor changes will be needed. I should work on it soon.
Ok, I've better understood this code. I've realized that flush=True
was there similarly to self._print_model_file
. I've brought it back.
To be done:
'u_0': '0.52807 +0.03417 -0.02608'
and we would like a list or a dict instead of a string that has 3 floats,sys.stdout
- @mjmroz what do you think?Tasks left + new ones:
_parse_results_MultiNest_multimodal()
,_parse_other_output_parameters()
,_print_yaml_best_model()
,
Adding output in YAML format was on my task list for quite some time. The obvious advantage is that such output can then be easily read using python scripts. I see your approach is to add
print(..., file=self._yaml_results_file)
in many places. This makes some functions quite long, so it would be good to make them shorter. The disadvantage is that the code structure is less clear - there are manyif self._yaml_results:
statements in different places of the code. The alternative would be to add to a dict everything that should go to the output file and print it at the end using something like:Here we get less control over how exactly the file looks like. I'm not yet sure which approach is better. Note that current changes do not work if fitting is done using MultiNest instead of EMCEE. Any opinions?