Skip to content
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

Fix a bug of plotter which contains inf #165

Merged
merged 7 commits into from
May 27, 2024
Merged

Fix a bug of plotter which contains inf #165

merged 7 commits into from
May 27, 2024

Conversation

zihaoxu98
Copy link
Collaborator

Sometimes the posterior contains inf, which corrupts the xy limit setting of the corner plot. This PR drops the iterations and samples with inf posterior.

@coveralls
Copy link

coveralls commented May 27, 2024

Pull Request Test Coverage Report for Build 9259389522

Details

  • 11 of 11 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 85.699%

Totals Coverage Status
Change from base Build 9166427409: 0.05%
Covered Lines: 2343
Relevant Lines: 2734

💛 - Coveralls

@mhliu0001
Copy link
Contributor

Thanks! It is also possible that the posterior is NaN. We should add that check as well and give a warning if it contains inf/NaN.

mhliu0001
mhliu0001 previously approved these changes May 27, 2024
self.prior = backend.get_blobs(discard=discard, thin=thin)
# We drop iterations with inf and nan posterior
mask = ~np.isinf(self.posterior) & ~np.isnan(self.posterior)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@dachengx dachengx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use numpy.isfinite

@zihaoxu98 zihaoxu98 requested a review from dachengx May 27, 2024 19:25
@dachengx dachengx merged commit 26837ba into master May 27, 2024
7 checks passed
@dachengx dachengx deleted the plotter_debug branch May 27, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants