Resolve "Add caching of the `generate_posterior_sample_from_marginalized_likelihood` method"
requested to merge 569-add-caching-of-the-generate_posterior_sample_from_marginalized_likelihood-method into master
This closes #569 (closed) and also fixes a number of other issues which popped up at the same time:
- Closes #569 (closed) the reconstruction is now cached
- The
normalize_constraint_factor
is not deterministic and changed between runs. This addresses this by calculating an average and rounding. - The
check_prob
andcheck_ln_prob
methods where missingratio
factors for floats - Cleans up the
cached_result
behaviour: if the cache result exists, it is loaded and repeated steps are avoided - Remove the prior check from the cache file calculation: this always fails for marginalized runs because the prior gets dynamically updated. The behaviour now means that if a use changes the prior and re-runs, the cached file will be used. However, this should be fairly obvious to the user while the alternative: rerunning and slightly changing results is more problematic.
- Simplify
samples_to_posterior
: move the check outside the function
Edited by Gregory Ashton