PyMultiNest
PyMultiNest copied to clipboard
add Analyzer instance to solve() output
Function solve()
returns more output. Then there is no need to re-read the file to run e.g., Analyzer.get_data()
.
I am wondering if this may cause issues with users who want to pickle the result.
Perhaps using the Solver class may be more suitable for use cases which should retain the state.
perhaps we should break up this function into the run() and analyse() part, so that the solver class can expose the analyzer.
One more approach would be to add return_analyzer
parameter to solve()
with defult value of False
. This will make the default behaviour same as now, but would return instance of Analyzer
if user wants. I can code that. Do you like this idea?
What problem are you trying to solve in the first place?
Remove the need to read the same files twice.
If this is just a mild nuisance to you but does not stop you from doing something for performance reasons, I am hesitant to make substantial changes, which could affect depending packages and increase maintenance complications.
For a return flag, we would have to check if BXA and other pymultinest using libraries on github would break.
This can be avoided by splitting the code into functions that the user can assemble differently than solve() does, to access intermediate parts.