Tidy up ProbabilisticModel and TrainableProbabilisticModel so that they are pure interfaces. Includes making SupportsPredictY a separate protocol, which improves static type checking.
Fully backwards compatible: no
A few breaking changes justified by simplifying the core type hierarchy. Migration is straightforward and will be properly documented.
ProbabilisticModel.log is now an abstract method and needs to be explicitly specified in any concrete model class implementation
ProbabilisticModel.get_module_with_variables is now a utility function in trieste.models.utils
TrainableProbabilisticModel.optimize_and_save_result and TrainableProbabilisticModel.last_optimization_result are now also utility functions (renamed to optimize_model_and_save_result and get_last_optimization_result)
PR checklist
[ ] The quality checks are all passing
[ ] The bug case / new feature is covered by tests
[ ] Any new features are well-documented (in docstrings or notebooks)
Related issue(s)/PRs:
Summary
Tidy up ProbabilisticModel and TrainableProbabilisticModel so that they are pure interfaces. Includes making
SupportsPredictY
a separate protocol, which improves static type checking.Fully backwards compatible: no
A few breaking changes justified by simplifying the core type hierarchy. Migration is straightforward and will be properly documented.
ProbabilisticModel.log
is now an abstract method and needs to be explicitly specified in any concrete model class implementationProbabilisticModel.get_module_with_variables
is now a utility function intrieste.models.utils
TrainableProbabilisticModel.optimize_and_save_result
andTrainableProbabilisticModel.last_optimization_result
are now also utility functions (renamed tooptimize_model_and_save_result
andget_last_optimization_result
)PR checklist