Skip to content

Commit

Permalink
fix: sort properly the conserved_moieties to match their existence
Browse files Browse the repository at this point in the history
  • Loading branch information
carrascomj committed Jun 21, 2024
1 parent 752a4f6 commit ce39423
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions maud/data_model/kinetic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,11 @@ def correct_conserved_moieties_defined(self):
left_nullspace = self.left_nullspace.values
left_nullspace = left_nullspace.astype(int)
if len(left_nullspace) > 0:
mgs = sorted(
[con_moi.moiety_group for con_moi in self.conserved_moiety]
)
cms = sorted(
[
[m for m, n in zip(balanced_metabolites, lns) if n]
for lns in left_nullspace
]
)
mgs = [sorted(con_moi.moiety_group) for con_moi in self.conserved_moiety]
cms = [
sorted([m for m, n in zip(balanced_metabolites, lns) if n])
for lns in left_nullspace
]
for cm in cms:
assert (
cm in mgs
Expand Down

0 comments on commit ce39423

Please sign in to comment.