コード例 #1
0
ファイル: test_matrix.py プロジェクト: sgalkina/memote
def test_degrees_of_freedom(model):
    """
    Show degrees of freedom of the S-Matrix.

    This test will return the degrees of freedom, i.e. "free variables" of the
    S-Matrix.

    This test is not scored, as the degrees of freedom depends on S-Matrix
    constructed, which is system-specific.
    """
    ann = test_degrees_of_freedom.annotation
    ann["data"] = matrix.degrees_of_freedom(model)
    ann["message"] = wrapper.fill(
        """The degrees of freedom of the S-Matrix is {}.""".format(
            ann["data"]))
コード例 #2
0
def test_degrees_of_freedom(model):
    """
    Show the degrees of freedom of the stoichiometric matrix.

    The degrees of freedom of the stoichiometric matrix, i.e., the number
    of 'free variables' is system specific and corresponds to the dimension
    of the (right) null space of the matrix.

    Implementation:
    Compose the stoichiometric matrix, then calculate the dimensionality of the
    null space using the rank-nullity theorem outlined by
    Alama, J. The Rank+Nullity Theorem. Formalized Mathematics 15, (2007).

    """
    ann = test_degrees_of_freedom.annotation
    ann["data"] = matrix.degrees_of_freedom(model)
    # Report the degrees of freedom scaled by the number of reactions.
    ann["metric"] = ann["data"] / len(model.reactions)
    ann["message"] = wrapper.fill(
        """The degrees of freedom of the S-Matrix are {}.""".format(
            ann["data"]))
コード例 #3
0
ファイル: test_for_matrix.py プロジェクト: fmmelab/memote
def test_degrees_of_freedom(model, num):
    assert matrix.degrees_of_freedom(model) == num