Fix abstract RandomRegularDepthOneFit and test_random_regular.py not running #34
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.
Summary
Tests in
test/training/models/were not running with stestr (CI and Tox) as it is missing an__init__.pyfile (see #33). Running these tests showed thatRandomRegularDepthOneFitwas abstract, and thus tests failed. This PR also fixes this by implementingRandomRegularDepthOneFit.minimization(), raising an error as minimization is not defined for the trainer (see below for details).Details and comments
stestr requires the test folder to be importable as a module, and thus
__init__.pyfiles are needed in every folder withtest_*.pyfiles. An__init__.pyfile was missing intest/training/models/up until now and thustest_random_regular_fit.pywas never run with CI unit-tests. As an example, see the latest commit as of this PR (ab7eaea) and associated Linux tests. We would expect there to be a line printed by stestr containing the stringtest.training.models.test_random_regular_fit.TestRandomRegularModel, but there is not, showing that these tests were never run.The tests for
RandomRegularDepthOneFitwere failing because it was missingminimization()and was abstract. The fix in this PR defines the method but with a raised error, asminimization()is not defined for this type of trainer. The class maps a problem instance to the closest known optimised parameters for a regular graph, based on average degree. There is no minimization carried out in this scenario.Version updated
Not currently necessary.