Commit 8cfff060 authored by eladnoor's avatar eladnoor

fixing isort config

parent 03600bf9
Pipeline #49857204 (#136) passed with stages
in 21 minutes and 7 seconds
......@@ -33,8 +33,8 @@ install_requires =
pyparsing>=2.2.0
sbtab>=0.9.49
matplotlib>=3.0.0
equilibrator-cache>=0.1.9
component-contribution>=0.1.6
equilibrator-cache>=0.2.0
component-contribution>=0.2.0
python_requires = >=3.6
tests_require =
tox
......@@ -72,6 +72,7 @@ filterwarnings =
ignore::DeprecationWarning:libsbml
[isort]
skip = __init__.py
line_length = 80
indent = 4
multi_line_output = 4
......
......@@ -232,7 +232,7 @@ class Pathway(object):
:return: the reaction IDs
"""
return map(lambda rxn: rxn.reaction_id, self.reactions)
return map(lambda rxn: rxn.rid, self.reactions)
@property
def reaction_formulas(self) -> Iterable[str]:
......
......@@ -25,16 +25,16 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from collections import namedtuple
import re
from typing import Tuple, Set
from collections import namedtuple
from typing import Set, Tuple
import numpy as np
from equilibrator_cache import Compound
from equilibrator_cache.reaction import Reaction
from equilibrator_cache.thermodynamic_constants import legendre_transform
from . import Q_, R, ureg, ccache
from . import Q_, R, ccache, ureg
AQUEOUS_PHASE_NAME = 'aqueous'
......@@ -396,9 +396,11 @@ class PhasedCompound(object):
@property
def first_name(self):
"""Get the first name that appears in the compound-cache."""
# TODO: use MetaNetX database to get the first name
return ccache.get_compound_first_name(self.compound)
@property
def names(self) -> Set[str]:
"""Get the set of all associated names in the compound cache."""
return ccache.get_compound_names(self.compound)
......@@ -27,7 +27,7 @@
import logging
from typing import Dict, List, Tuple, KeysView, Iterable
from typing import Dict, List, Tuple
import numpy as np
from equilibrator_cache.reaction import Reaction
......@@ -63,7 +63,7 @@ class PhasedReaction(Reaction):
{PhasedCompound(cpd): coeff for cpd, coeff in sparse.items()}
if self.rid is None:
self.reaction_id = 'COCO:R%05d' % PhasedReaction.REACTION_COUNTER
self.rid = 'COCO:R%05d' % PhasedReaction.REACTION_COUNTER
PhasedReaction.REACTION_COUNTER += 1
def clone(self):
......@@ -72,11 +72,14 @@ class PhasedReaction(Reaction):
self.sparse_with_phases.copy())
def reverse(self):
sparse = {cpd: -coeff
for (cpd, coeff) in self.sparse.items()}
sparse_with_phases = {cpd: -coeff
for (cpd, coeff) in self.sparse_with_phases.items()}
"""Return a PhasedReaction with the reverse reaction."""
sparse = {
cpd: -coeff for (cpd, coeff) in self.sparse.items()
}
sparse_with_phases = {
cpd: -coeff for (cpd, coeff) in self.sparse_with_phases.items()
}
return PhasedReaction(sparse, self.arrow, self.rid,
sparse_with_phases)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment