Skip to content

Commit 7ea50ad

Browse files
author
uri.akavia
committed
minor fixes
1 parent 9baeaa6 commit 7ea50ad

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/cobra/core/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ def existing_filter(new_group: Group) -> bool:
899899
"""
900900
if new_group.id in self.groups:
901901
logger.warning(
902-
f"Ignoring group '{new_group.id}'" f" since it already exists."
902+
f"Ignoring group '{new_group.id}' since it already exists."
903903
)
904904
return False
905905
return True

src/cobra/core/reaction.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@ def metabolites(self, value: Dict[Metabolite, float]) -> None:
585585
"""Set metabolites to a dictionary of metabolites and coefficients.
586586
587587
Parameters
588-
-------
589-
metabolites: Dict[Metabolite, float]
588+
----------
589+
value: Dict[Metabolite, float]
590590
A dictionary of cobra.Metabolite for keys and floats for coeffecieints.
591591
Positive coefficient means the reaction produces this metabolite, while
592592
negative coefficient means the reaction consumes this metabolite.
@@ -1034,7 +1034,7 @@ def __iadd__(self, other: "Reaction") -> "Reaction":
10341034
rule2 = other.gene_reaction_rule.strip()
10351035
if rule1 != "" and rule2 != "":
10361036
self.gene_reaction_rule = (
1037-
f"({self.gene_reaction_rule}) and " f"({other.gene_reaction_rule})"
1037+
f"({self.gene_reaction_rule}) and ({other.gene_reaction_rule})"
10381038
)
10391039
elif rule1 != "" and rule2 == "":
10401040
self.gene_reaction_rule = rule1
@@ -1247,13 +1247,12 @@ def add_metabolites(
12471247

12481248
# Make sure metabolites being added belong to the same model, or
12491249
# else copy them.
1250-
if isinstance(metabolite, Metabolite):
1251-
if (
1252-
(metabolite.model is not None)
1253-
and self.model
1254-
and (metabolite.model is not self._model)
1255-
):
1256-
metabolite = metabolite.copy()
1250+
if isinstance(metabolite, Metabolite) and (
1251+
(metabolite.model is not None)
1252+
and self.model
1253+
and (metabolite.model is not self._model)
1254+
):
1255+
metabolite = metabolite.copy()
12571256

12581257
met_id = str(metabolite)
12591258
# If a metabolite already exists in the reaction then

0 commit comments

Comments
 (0)