Skip to content

Commit

Permalink
Change the units for dfba_obj_species
Browse files Browse the repository at this point in the history
  • Loading branch information
YinHoon committed Sep 7, 2020
1 parent 33fc1dc commit 832e8f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/eukaryote/test_metabolism.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ def test_gen_reactions_and_rate_laws(self):
'atp[c]': -48, 'gtp[c]': -60, 'amp[c]': 76, 'cmp[c]': 40, 'gmp[c]': 40, 'ump[c]': 40, 'h2o[c]': -240 + (10*scipy.constants.Avogadro - 1), 'h[c]': 216,
'adp[c]': 12, 'pi[c]': 144, 'gdp[c]': 60, 'ala_L[c]': -36, 'met_L[c]': -12, 'h2o[l]': -24, 'ala_L[l]': 24, 'met_L[l]': 8,
})
for i in biomass_reaction.dfba_obj_species:
self.assertEqual(i.units, unit_registry.parse_units('molecule cell^-1'))
self.assertEqual(model.species_types.get_one(id='carbohydrate').structure.molecular_weight, 2000.*scipy.constants.Avogadro + 20.)
self.assertEqual(model.species_types.get_one(id='carbohydrate').structure.charge, 10*scipy.constants.Avogadro)
self.assertEqual(model.species.get_one(id='carbohydrate[c]').distribution_init_concentration.mean, 1.)
Expand Down
1 change: 1 addition & 0 deletions wc_model_gen/eukaryote/metabolism.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ def gen_reactions(self):

for species in biomass_rxn.dfba_obj_species:
species.id = species.gen_id()
species.units = unit_registry.parse_units('molecule cell^-1')

# Add biomass reaction as objective function
submodel.dfba_obj = wc_lang.DfbaObjective(model=model)
Expand Down

0 comments on commit 832e8f2

Please sign in to comment.