Skip to content

Commit 01c6c3a

Browse files
author
uri.akavia
committed
minor fixes
1 parent 0b10a81 commit 01c6c3a

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/cobra/core/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ def existing_filter(new_group: Group) -> bool:
915915
"""
916916
if new_group.id in self.groups:
917917
logger.warning(
918-
f"Ignoring group '{new_group.id}'" f" since it already exists."
918+
f"Ignoring group '{new_group.id}' since it already exists."
919919
)
920920
return False
921921
return True

src/cobra/core/reaction.py

+9-10
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.
@@ -1014,7 +1014,7 @@ def __iadd__(self, other: "Reaction") -> "Reaction":
10141014
rule2 = other.gene_reaction_rule.strip()
10151015
if rule1 != "" and rule2 != "":
10161016
self.gene_reaction_rule = (
1017-
f"({self.gene_reaction_rule}) and " f"({other.gene_reaction_rule})"
1017+
f"({self.gene_reaction_rule}) and ({other.gene_reaction_rule})"
10181018
)
10191019
elif rule1 != "" and rule2 == "":
10201020
self.gene_reaction_rule = rule1
@@ -1227,13 +1227,12 @@ def add_metabolites(
12271227

12281228
# Make sure metabolites being added belong to the same model, or
12291229
# else copy them.
1230-
if isinstance(metabolite, Metabolite):
1231-
if (
1232-
(metabolite.model is not None)
1233-
and self.model
1234-
and (metabolite.model is not self._model)
1235-
):
1236-
metabolite = metabolite.copy()
1230+
if isinstance(metabolite, Metabolite) and (
1231+
(metabolite.model is not None)
1232+
and self.model
1233+
and (metabolite.model is not self._model)
1234+
):
1235+
metabolite = metabolite.copy()
12371236

12381237
met_id = str(metabolite)
12391238
# If a metabolite already exists in the reaction then

0 commit comments

Comments
 (0)