Skip to content

Commit

Permalink
fix iffy biomass exchanges in some models
Browse files Browse the repository at this point in the history
  • Loading branch information
cdiener committed Apr 1, 2021
1 parent 56185b7 commit 3fc0817
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import micom
from os.path import dirname, join
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
4 changes: 4 additions & 0 deletions micom/community.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ def __add_exchanges(
"Reaction %s seems to be an exchange " % r.id
+ "reaction but its ID does not start with 'EX_'..."
)
# Some AGORA models label the biomass demand as exchange
if any(bm in r.id.lower() for bm in ["biomass", "bm"]):
r.id = r.id.replace("EX_", "DM_")
continue

export = len(r.reactants) == 1
if export:
Expand Down

0 comments on commit 3fc0817

Please sign in to comment.