Skip to content

Commit

Permalink
Added functionality for pressure model for the species. 06/26/2024
Browse files Browse the repository at this point in the history
This completes the built of multiple species convection model functionality.
  • Loading branch information
dukovski committed Jun 26, 2024
1 parent 0ebe8d2 commit 0d853ce
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 7 deletions.
6 changes: 3 additions & 3 deletions build/lib/cometspy/comets.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
__copyright__ = "Copyright 2024, The COMETS Consortium"
__credits__ = ["Djordje Bajic", "Jean Vila", "Jeremy Chacon", "Ilija Dukovski"]
__license__ = "MIT"
__version__ = "0.5.0"
__comets_compatibility__ = "2.12.0" # version of comets this was tested with (except signaling)
__comets_compatibility_signaling__ = "2.12.0" # version signaling was tested with
__version__ = "0.5.1"
__comets_compatibility__ = "2.12.2" # version of comets this was tested with (except signaling)
__comets_compatibility_signaling__ = "2.12.2" # version signaling was tested with

__maintainer__ = "Djordje Bajic"
__email__ = "[email protected]"
Expand Down
24 changes: 24 additions & 0 deletions build/lib/cometspy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def __init__(self, model : cobra.Model = None, randomtag : bool = False):
self.optimizer = 'GUROBI'
self.obj_style = 'MAXIMIZE_OBJECTIVE_FLUX'

self.multispecies_convmodel_flag = False



if model is not None:
if isinstance(model, cobra.Model):
self.load_cobra_model(model, randomtag)
Expand Down Expand Up @@ -339,6 +343,21 @@ def add_convection_parameters(self, packedDensity : float =1.,
'elasticModulus': elasticModulus,
'frictionConstant': frictionConstant,
'convDiffConstant': convDiffConstant}

def add_multspecies_convmodel_parameters(self, pressureKappa : float, pressureExponent : float, packBiomass : float, maxPressure : float):
if not isinstance(pressureKappa, float):
raise ValueError('pressureKappa must be a float')
if not isinstance(pressureExponent, float):
raise ValueError('pressureExponent must be a float')
if not isinstance(packBiomass, float):
raise ValueError('packBiomass must be a float')
if not isinstance(maxPressure, float):
raise ValueError('maxPressure must be a float')
self.multispecies_convmodel_flag = True
self.multimodel_parameters = {'pressureKappa': pressureKappa,
'pressureExponent': pressureExponent,
'packBiomass': packBiomass,
'maxPressure': maxPressure}

def add_noise_variance_parameter(self, noiseVariance : float):
""" sets the noise variance parameter
Expand Down Expand Up @@ -1074,6 +1093,11 @@ def write_comets_model(self, working_dir : str = None):
for key, value in self.convection_parameters.items():
f.write(key + ' ' + str(value) + '\n')
f.write(r'//' + '\n')

if self.multispecies_convmodel_flag:
for key, value in self.multimodel_parameters.items():
f.write(key + ' ' + str(value) + '\n')
f.write(r'//' + '\n')

if self.nonlinear_diffusion_flag:
for key, value in self.nonlinear_diffusion_parameters.items():
Expand Down
4 changes: 2 additions & 2 deletions cometspy.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Metadata-Version: 2.1
Name: cometspy
Version: 0.5.0
Version: 0.5.1
Summary: The Python interface to COMETS
Home-page: https://github.com/segrelab/cometspy
Download-URL: https://github.com/segrelab/cometspy/archive/v0.5.0.tar.gz
Download-URL: https://github.com/segrelab/cometspy/archive/v0.5.1.tar.gz
Author: The COMETSPy Core Team
Author-email: [email protected]
License: GPL
Expand Down
Binary file modified cometspy/__pycache__/comets.cpython-39.pyc
Binary file not shown.
Binary file modified cometspy/__pycache__/model.cpython-39.pyc
Binary file not shown.
Binary file removed dist/cometspy-0.5.0.tar.gz
Binary file not shown.
Binary file not shown.
Binary file added dist/cometspy-0.5.1.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
setup(
name='cometspy',
packages=['cometspy'],
version='0.5.0',
version='0.5.1',
license='GPL',
description='The Python interface to COMETS',
author='The COMETSPy Core Team',
author_email='[email protected]',
url='https://github.com/segrelab/cometspy',
download_url='https://github.com/segrelab/cometspy/archive/v0.5.0.tar.gz', # New releases here!!
download_url='https://github.com/segrelab/cometspy/archive/v0.5.1.tar.gz', # New releases here!!
keywords=['metabolism', 'dynamic', 'flux', 'balance', 'analysis', 'spatial', 'evolution'],
install_requires=[
# I get to this in a second
Expand Down

0 comments on commit 0d853ce

Please sign in to comment.