Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #925 +/- ##
===========================================
+ Coverage 89.41% 90.24% +0.83%
===========================================
Files 63 73 +10
Lines 4857 5692 +835
===========================================
+ Hits 4343 5137 +794
- Misses 514 555 +41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
martinjrobins
left a comment
There was a problem hiding this comment.
looks good, couple of questions around distribution = None / unbounded
pybop/parameters/distributions.py
Outdated
|
|
||
| def __init__( | ||
| self, | ||
| distribution: stats.distributions.rv_frozen | None = None, |
There was a problem hiding this comment.
what does distribution=None mean? unbounded? need to add to the docstring
There was a problem hiding this comment.
To make things clearer, I have added the BaseDistribution class - which can be used as a placeholder for an empty parameter.
pybop/parameters/parameter.py
Outdated
| def __init__( | ||
| self, | ||
| distribution: stats.distributions.rv_frozen | Distribution | None = None, | ||
| distribution: Distribution | None = None, |
There was a problem hiding this comment.
again, what is distribution=None mean?
There was a problem hiding this comment.
Added to the description:
distribution : BaseDistribution, optional
Probability distribution for the parameter. If None, an empty
`pybop.BaseDistribution` will return a NotImplementedError for any
functionality that requires a distribution, such as `rvs`.
There was a problem hiding this comment.
but what does it mean from a user perspective? Does it mean that the parameter is unbounded? Or that it can't be used in sampling, or multi-start optimisation?
There was a problem hiding this comment.
If no distribution, bounds or initial value is specified, an empty Parameter with an empty BaseDistribution will be created. It doesn't really mean anything... but it should return a somewhat helpful error when something is required but not implemented. It has no bounds and yes, it cannot be used for sampling (no mean or cov) or multi-start optimisation (no rvs).
Description
The implementation of parameters, distributions and transformations is over-complicated. The aim here is to simplify the definitions and interactions between these classes to improve maintainability. A new
UnboundedDistributionis created to define the behaviour of a parameter without a statistical distribution. Theget_transformed_distributionfunctionality is added to both univariate and multivariate distributions.Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #).
Important checks:
Please confirm the following before marking the PR as ready for review:
$ pre-commit runor$ nox -s pre-commit(see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)nox -s testsnox -s doctest