Don't overload `rand` for test models
In TestUtils we're currently overloading rand(rng, ::Type{NamedTuple}, model) which is supposed to represent a "ground truth sample from the prior", which, IMO, we shouldn't be doing.
The problem is that it will silently "do the right thing" for most models, even if we've forgotten to implement this method, e.g. as seen in #499. I remember this being part of our original discussion when TestUtils was introduced (I was in favour of what is suggested in this issue, but we ended up overloading rand instead).
This just a bit me again trying to do condition on one of the test models and running rand...
@devmotion I believe we had a discussion about this in the original PR; you happy with me to go ahead with making this change?
I don't remember the discussion 😅 Not completely clear to me from your comments what exactly the problem is but I'm happy with a PR that fixes current issues 🙂
Not completely clear to me from your comments what exactly the problem is
If I want to test, say, the condition behavior, I might do something like:
model = DynamicPPL.TestUtils.DEMO_MODELS[1]
rand(model | (m = 1,))
and check that m is no longer present in the output of rand; currently this always produces the same result because rand is hard-coded for model :grimacing:
But bueno! Will do that then :+1:
This has been removed at some point:)