Stone-Soup icon indicating copy to clipboard operation
Stone-Soup copied to clipboard

CombinedLinear Gaussian Transition Model

Open gbellantuono opened this issue 3 years ago • 1 comments

One issue that we noticed is regarding the CombinedLinearGaussianTransitionModel.

For example looking at the metric example we have a KalmanPredictor. This has the following property:

transition_model: LinearGaussianTransitionModel = Property( doc="The transition model to be used.")

In the Example the transition model chosen is CombinedLinearGaussianTransitionModel. Looking at the code the class is the following:

class CombinedLinearGaussianTransitionModel(LinearModel, _CombinedGaussianTransitionModel):

So the type is not LinearGaussianModel and neither are _CombinedGaussianTransitionModel(TransitionModel, GaussianModel): and class LinearModel(Model):

Because the UInterface uses the parents and children classes to give the opportunity to choose the class, in our case is not possible to select CombinedLinearGaussianTransitionModel as property of the KalmanPredictor.

Maybe class CombinedLinearGaussianTransitionModel(LinearModel, _CombinedGaussianTransitionModel) should have LinearGaussianTransitionModel as parent class?

We can't see the link between KalmanPredictor and CombinedLinearGaussianTransitionModel

gbellantuono avatar Nov 23 '21 13:11 gbellantuono

The current model inheritance hierarchy certainly isn't clear. A quick fix to your issue might be to register CombinedLineaerGaussianTransitionModel as a subclass of LinearGaussianTransitionModel.

For an example of subclass registering, see: https://github.com/dstl/Stone-Soup/blob/0cc1eabd4ba525f55970e7bf41416dab663bbefe/stonesoup/types/state.py#L472

By registering as a subclass, the class will be inserted in to the inheritance hierarchy without the need to inherit the superclass' attributes and methods.

oharrald-Dstl avatar Jan 05 '22 14:01 oharrald-Dstl