Added unit tests for all region graphs (RGs) (>95% coverage with pytest --cov), and some fixes and additional features.
Bugs to be solved:
[fixed] It seems that the topological_layers method of RGs does not terminate when executed for retrieving a "top-down" list of layers. Can we just use the bottom-up implementation and reverse the resulting list?
Fixed bugs and additional features:
Fixed region graph loading not working for region graphs with only one root region and no partitions.
The scope component of the sort_id of RG nodes is now sorted. This is crucial in order to maintain the same ordering on RG nodes after re-loading a RG from disk.
Added check_random_state in cirkit.utils.random to deal with both random seeds and Numpy random states smoothly. This feature was used to ensure consistent test runs.
Implemented routines in tests/test_region_graph.py for checking smoothness, decomposability and "strong" structured-decomposability (i.e., without re-arrangement of partitions). This should be moved to cirkit as utility methods of RGs.
Miscellaneous:
[done] Why is the delta factor a float in the Poon Domingos structure. Shouldn't it be an integer greater than 0 ?
Adding doc-strings in tests may be overkill. I have just placed # pylint: disable=missing-function-docstring.
[done] Can we merge lib requirement sets lint and test with dev, since for linting test source files it is necessary to install pytest ?
Added unit tests for all region graphs (RGs) (>95% coverage with
pytest --cov
), and some fixes and additional features.Bugs to be solved:
topological_layers
method of RGs does not terminate when executed for retrieving a "top-down" list of layers. Can we just use the bottom-up implementation and reverse the resulting list?Fixed bugs and additional features:
sort_id
of RG nodes is now sorted. This is crucial in order to maintain the same ordering on RG nodes after re-loading a RG from disk.check_random_state
incirkit.utils.random
to deal with both random seeds and Numpy random states smoothly. This feature was used to ensure consistent test runs.tests/test_region_graph.py
for checkingsmoothness
,decomposability
and "strong"structured-decomposability
(i.e., without re-arrangement of partitions). This should be moved tocirkit
as utility methods of RGs.Miscellaneous:
delta
factor afloat
in the Poon Domingos structure. Shouldn't it be an integer greater than 0 ?# pylint: disable=missing-function-docstring
.lint
andtest
withdev
, since for linting test source files it is necessary to installpytest
?Closes #37 .