-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add error hint for MethodErrors on LogDensityModel #146
Conversation
Co-authored-by: David Widmann <[email protected]>
(Thanks on both points :)) |
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.
Maybe it would be good to add a (very simple) test as well to ensure it works as intended?
a6b135e
to
13ebdab
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #146 +/- ##
==========================================
+ Coverage 97.19% 97.23% +0.04%
==========================================
Files 8 8
Lines 321 326 +5
==========================================
+ Hits 312 317 +5
Misses 9 9 ☔ View full report in Codecov by Sentry. |
13ebdab
to
bf9d733
Compare
bf9d733
to
d514c33
Compare
If a user creates their own AbstractMCMC sampler and passes it something that obeys the LogDensityProblems.jl interface, AbstractMCMC quietly wraps it in a
LogDensityModel
type which doesn't obey the same interface, which can be mildly confusing. (Well, it did catch me out, so there may be other new users out there too who bumped into it too :))As this is a conscious decision (cf. #110 (comment)) this PR makes it such that if somebody tries to call LogDensityProblems.jl methods on a LogDensityModel, they get a friendly nudge in the right direction.
MWE: