tests/subfiles.py

Mon, 22 Jan 2018 18:23:25 +0200

author
Santeri Piippo
date
Mon, 22 Jan 2018 18:23:25 +0200
changeset 23
1b9645b7ddb0
child 24
f8080ffceaa9
permissions
-rw-r--r--

added matrix all zero test

from testsuite import error

def determinant_test(model):
    yield from [
        error(subfile_reference, 'zero-determinant')
        for subfile_reference in model.subfile_references
        if abs(subfile_reference.matrix.determinant() - 0) < 1e-15
    ]

manifest = {
    'tests': {
        'determinant': determinant_test,
    },
    'messages': {
        'zero-determinant': 'matrix determinant is zero '
            '(row or column all zero)',
    },
}

mercurial