-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1218 from opencobra/refactor/flake8-solution
refactor: flake8 resolution for cobra.Solution
- Loading branch information
Showing
2 changed files
with
109 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Test functions of solution.py .""" | ||
|
||
"""Test functions of solution.py""" | ||
|
||
from __future__ import absolute_import | ||
from typing import TYPE_CHECKING, Tuple | ||
|
||
from cobra.core import Solution | ||
|
||
|
||
def test_solution_contains_only_reaction_specific_values(solved_model): | ||
if TYPE_CHECKING: | ||
from cobra import Model | ||
|
||
|
||
def test_solution_contains_only_reaction_specific_values( | ||
solved_model: Tuple[Solution, "Model"] | ||
) -> None: | ||
"""Test solution contains specific reaction values.""" | ||
solution, model = solved_model | ||
reaction_ids = set([reaction.id for reaction in model.reactions]) | ||
if isinstance(solution, Solution): | ||
assert set(solution.fluxes.index) == reaction_ids | ||
# assert set(solution.reduced_costs.index) == reaction_ids | ||
else: | ||
raise TypeError("solutions of type {0:r} are untested".format(type(solution))) | ||
assert set(solution.fluxes.index) == reaction_ids | ||
# assert set(solution.reduced_costs.index) == reaction_ids |