-
Notifications
You must be signed in to change notification settings - Fork 12
add a DistributionLogPotential #102
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
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #102 +/- ##
==========================================
+ Coverage 84.28% 84.99% +0.70%
==========================================
Files 79 80 +1
Lines 2214 2232 +18
==========================================
+ Hits 1866 1897 +31
+ Misses 348 335 -13
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Using some inner constructor magic, I was able to simplify the interface to
which should feel much nicer compared to the previous one which required the user to wrap the reference
This does complicate maintaining the code for Inputs. At the same time, I think that making the API nicer will necessarily involve having more complex entry points to pigeons -- and Inputs is perhaps the most relevant point of entry. Still, I'm not too sure if having this simplification is worth the extra code or not. Thoughts @alexandrebouchard ? |
Thanks Miguel to keep pushing this, I think it is important indeed. The part of the PR about the new About the other part of the PR, i.e the "syntactic sugar" to avoid having to write the name of the wrapper: I am undecided. On one hand I agree this is useful to simplify frequently-used syntax. So for the user-facing behaviour I like it too. But the internal implementation I am not a huge fan of. One concern is if we add auto-wrapping behaviour for one type of LogPotential, I think we want to have a mechanism that would scale to doing the same for other LogPotentials. I can see at least one similar example: to skip the wrapper around Turing models. And to allow doing so both in the target slot and in the reference slot potentially (see * above, less sure about this second point). The proposed internal implementation might get even messier in that case (feel free to convince me otherwise). Can we quickly explore if there might not be alternatives for implementing the wrapping of Inputs argument(s)? One idea: can we use the Another route would be to search for all I wonder also if Julia's built-in but extensible |
100%. I was on the verge here too. Happy to roll back. Let's keep this PR to the DistributionLogPotential. Perhaps the wrapping part can be done as part of a more ambitious BreadCrumbs PR. Which we should discuss over 🍻. |
Looks good to me! |
Thanks Miguel!! |
This PR a follow-up after the comments received on #99. It simply aims to have a container for Distributions objects that allow us to use these as references for Pigeons. This can be achieved by minimally affecting the current codebase -- basically, it only requires modifying the default behavior of
initialization
methods when constructing Replicas.To see example usage, look at the test file.