Open
Description
Problem description
To future-proof cobrapy it migh make sense to offer compartments not just as a dictionary but as objects like all the other model components. While adding little overhead in terms of performance (the larges model I've seen had 14 compartments), I think this would have a lot of benefits such as allowing users to store information on compartment size (pH, molecular size potentially relevant for ME-model-esque calculations) and compartment-specific annotation (type of compartment, SBO terms, literature reference and whatnot).
Code Sample in Jupyter Notebook
IN[1]: model.compartment.c
OUT[1]:
"""
Compartment identifier | c
-- | --
Name | Cytosol
Memory address | 0x011c852e90
pH | 6.7
Contains 4 metabolites| pyr_c, g6p_c, g3p_c, f6p_c
"""
IN[2]: model.compartment.c.annotation
OUT[2]:
{'SBO': 'SBO:0000247',
'ImaginaryCompDB':'SpecificCompIdentifier'}