Related issue(s)/PRs: resolves re-init issue discussed in #825
Summary
This PR adds a property to trust-regions, allowing a rule to determine if a region needs to be re-initialized. The rule can then call the initialize method directly on the region. Previously this decision was made internally by the regions. This resulted in an issue for product spaces where the re-init of sub-regions wasn't coordinated. This PR resolves that issue.
Fully backwards compatible: no
There is a minor incompatibility that the regions are now required to set self._initialized to True in their initialize method. This instance variable starts off as False and should be set to True in any derived initialize methods.
PR checklist
[X] The quality checks are all passing
[X] The bug case / new feature is covered by tests
[X] Any new features are well-documented (in docstrings or notebooks)
Related issue(s)/PRs: resolves re-init issue discussed in #825
Summary
This PR adds a property to trust-regions, allowing a rule to determine if a region needs to be re-initialized. The rule can then call the
initialize
method directly on the region. Previously this decision was made internally by the regions. This resulted in an issue for product spaces where the re-init of sub-regions wasn't coordinated. This PR resolves that issue.Fully backwards compatible: no There is a minor incompatibility that the regions are now required to set
self._initialized
toTrue
in theirinitialize
method. This instance variable starts off asFalse
and should be set toTrue
in any derivedinitialize
methods.PR checklist