The following lines in diagrams.enumerate_partial_diagrams() should be changed such that a specific error is raised:
# get the cofactor matrix
K_cof = _get_cofactor_matrix(K_laplace=K_laplace)
# check that all values in the cofactor matrix are the same by
# checking if minimum and maximum values are equal
assert K_cof.min() == K_cof.max()
For this case it would be far better to raise an error with an error message and leave assertions for tests.
After reviewing this again I think I'm going to close it. If an AssertionError is raised I think the comment will be sufficient to understand the cause.
The following lines in
diagrams.enumerate_partial_diagrams()
should be changed such that a specific error is raised:For this case it would be far better to raise an error with an error message and leave assertions for tests.