-
Notifications
You must be signed in to change notification settings - Fork 219
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 remaining method ambiguities #2304
Conversation
We test ambiguities only for Turing and not its dependencies.
Concretely: 1. Creating an `AbstractTransition` type which all the Transitions in Turing subtype. 2. Modifying the type signature of bundle_samples to take a Vector{<:Union{AbstractTransition,AbstractVarInfo}} as the first argument. The AbstractVarInfo case occurs when sampling with Prior(), so the type signature of this argument mirrors that of the Sampler in the same function.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2304 +/- ##
==========================================
- Coverage 86.85% 86.79% -0.07%
==========================================
Files 24 24
Lines 1598 1598
==========================================
- Hits 1388 1387 -1
- Misses 210 211 +1 ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 10633882336Details
💛 - Coveralls |
Done by: 1. Constraining the type parameter to AbstractVector{Symbol} 2. Modifying the method below it to use a vector instead of a tuple
bundle_samples
It might cause issues but @devmotion, @torfjelde probably have thought more about this. |
My gut feeling is that right now an I think it could be useful to add an interface for accessing the most important properties of a transition to AbstractMCMC + a default |
To echo David's point, I think a default |
I agree that the fields of the different I'm in favour of having an overarching @mhauru: Regarding your point about other libraries: Right now some libraries in the Turing ecosystem have their own kind of I'm less certain about this, but I think it's also not possible to call Turing's (Please correct me if I'm wrong, I'm finding a lot of this quite difficult to reason about due to the complexity of the ecosystem + the fact that Julia lets you extend methods in other packages.) |
@penelopeysm, can you open an issue on
Your understanding is correct; hopefully, the complexity will decrease when you get more familiar with Turing and Julia. It will be even better if we simplify the design, e.g. DynamicPPL/AbstractPPL/JuliaBUGS. |
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.
looks good to me
This PR:
AbstractTransition
abstract type which all theTransitions
in Turing subtype.bundle_samples
(insrc/mcmc/Inference.jl
) to take aVector{<:Union{AbstractTransition,AbstractVarInfo}}
as the first argument. TheAbstractVarInfo
case occurs when sampling withPrior()
, so the type signature of this argument somewhat mirrors that of thesampler
argument in the same function (which isUnion{Sampler{<:InferenceAlgorithm},SampleFromPrior}
).Base.get
(insrc/optimisation/Optimisation.jl
) to take anAbstractVector{Symbol}
as the second argument.(4) is technically a breaking change because it is a more restrictive type signature, hence I've also bumped the version number to 0.34.0.
Closes #2261; extends #2290.