BUGFIX: Joint prior subclassing fixes #44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses multiple issues with the subclassing of BaseJointPrior lists and their reinitialization from
json
ordict
outlined in #31, implements fixes and also test cases that fail with the old implementation.The tests uncovered some new issues that required fixes beyond the (current) discussion in #31. The fixes are implemented by moving some of the logic used to re-initialize (subclasses of)
BaseJointPriorDist
fromMultivariateGaussianDist
toBaseJointPriorDist
.The tests also uncovered a problem with
__eq__
forJointPrior
that resulted in__eq__
givingFalse
if thedist
keyword does not point to the same instance. This, I felt, was inconsistent with the usage of__eq__
acrossPriorDict
.One overall change currently applied by this PR is that it is now easier to, by mistake, use a not-subclassed
BaseJointPriorDist
somewhere. I wonder, however, if theBaseJointPriorDist
methods that need be subclassed should not raise anNotImplemented
error anyway.