Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
tidy up of CopasiProcess script
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Feb 28, 2024
1 parent d8893c2 commit eb3b593
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions biosimulator_processes/processes/copasi_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class CopasiProcess(Process):
'biomodel_id': 'maybe[string]', # <-- implies the lack of either model_file or model_reactions
'units': 'maybe[tree[string]]',
'method': {
'_type': 'maybe[string]',
'_type': 'string',
'_default': 'lsoda'
}
}
Expand Down Expand Up @@ -118,9 +118,9 @@ def __init__(self, config=None, core=None):
self.copasi_model_object = new_model(name='CopasiProcess Model')

self.model_changes: Dict = self.config['model'].get('model_changes', {})
reaction_changes: Dict = self.model_changes.get('reaction_changes')

# add reactions
# add reactions
reaction_changes: Dict = self.model_changes.get('reaction_changes')
if reaction_changes:
for reaction_name, reaction_spec in reaction_changes.items():
add_reaction(
Expand Down Expand Up @@ -189,8 +189,10 @@ def outputs(self):
def update(self, inputs, interval):
# set copasi values according to what is passed in states
for cat_id, value in inputs['floating_species'].items():
set_species(name=cat_id, initial_concentration=value,
model=self.copasi_model_object)
set_species(
name=cat_id,
initial_concentration=value,
model=self.copasi_model_object)

# run model for "interval" length; we only want the state at the end
timecourse_args = {
Expand Down

0 comments on commit eb3b593

Please sign in to comment.