Skip to content
Snippets Groups Projects
Commit 64c34134 authored by Peter Schubert's avatar Peter Schubert
Browse files

reaction local parameters collect also units

parent 25504b56
Branches
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ class XbaReaction:
self.kinetic_law = s_reaction['kineticLaw'] if type(s_reaction['kineticLaw']) == str else ''
# convert to numpy, replace local parameters with numerical values, inline lambda functions:
expanded_kl = sbmlxdf.misc.mathml2numpy(self.kinetic_law)
for pid, val in self.local_params.items():
for pid, [val, _] in self.local_params.items():
expanded_kl = re.sub(r'\b' + pid + r'\b', str(val), expanded_kl)
self.expanded_kl = expand_kineticlaw(expanded_kl, functions)
for cid in compartments.keys():
......
......@@ -92,7 +92,7 @@ def get_local_params(reaction):
if 'localParams' in reaction:
for lp in record_generator(reaction['localParams']):
params = extract_params(lp)
local_params[params['id']] = float(params['value'])
local_params[params['id']] = [float(params['value']), params.get('units', 'dimensionless')]
return local_params
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment