-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to plot multimodal posteriors when the option is enabled. To … #451
Merged
thjsal
merged 11 commits into
main
from
415-posterior-post-processing-for-individual-mode
Dec 13, 2024
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9ecce3c
Changes to plot multimodal posteriors when the option is enabled. To …
yveskini c6989ae
Merge remote-tracking branch 'origin' into 415-posterior-post-process…
thjsal 54e989c
Making the multimode plotting work for multiple models
yveskini b970d80
Fixing mode names
yveskini 535426e
Finxing mode name, and fixing bug for many model to be shown
yveskini 3c09024
Merge branch '415-posterior-post-processing-for-individual-mode' of h…
thjsal 97c6bab
Errors, warnings, and comments added.
thjsal c304a40
Typo fixed.
thjsal 5eb9935
Corrected multi mode issues
lmauviard c06d0d9
Merge branch 'main' into 415-posterior-post-processing-for-individual…
thjsal cf7309a
Old comment removed.
thjsal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it it be this line that is the problem? Is this saving the number of modes in some model specific variable, or to something that gets overwritten every time a new model is loaded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the
mode_len
should be run-specific, since even different runs can have different number of modes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think there are a few issues. First of all, the number of modes (and the other mode info too) is saved to a class variable that gets overwritten every time runs to new models are loaded. Secondly, this does not seem to work (at least in a general case) either if loading many runs for the same model, since it assumes that all the runs have the same number of modes.
I am not sure if there is an easy way to fix it, but maybe we can just raise errors/warnings if somebody tries to use this with multiple models/runs, or at least warn about this in the docstring. EDIT: I have done that now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A solution for the 1st issue would be to make multi-modes variables (like
mode_len
) not class variables. This can be achieved by replacingreturn cls(runs, likelihood, ID, **kwargs)
by something likeRuns = cls(runs, likelihood, ID, **kwargs)
Runs.mode_len =len(modes)
return Runs
For the second issue, this can be fixed by storing the
mode_len
and other such values in form of a dictionary, with the keys being the run ID and the values themode_len
?If you agree I can do it quickly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, those sounds like good ideas to me. Please go ahead if you like. I think you should then also change
mode_label
to not be a class variable either (so that different models can have different labels).And I guess we still need to assume that if we set
multi_mode=True
, all the loaded runs should have been run using the MultiNest set tommodal=True
? EDIT: Or if not, we can make that an array of booleans instead of one boolean.