From 3fc08171d42ea687971b3f2b50f0cfb560f49027 Mon Sep 17 00:00:00 2001 From: Christian Diener Date: Wed, 31 Mar 2021 18:11:52 -0700 Subject: [PATCH] fix iffy biomass exchanges in some models --- docs/source/conf.py | 2 -- micom/community.py | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 8525d113..2def393b 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 diff --git a/micom/community.py b/micom/community.py index 97711a20..7cdf1ad8 100755 --- a/micom/community.py +++ b/micom/community.py @@ -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: