Skip to content

Commit

Permalink
#3 Use reaction ids
Browse files Browse the repository at this point in the history
  • Loading branch information
kwabenantim committed Nov 14, 2023
1 parent 449826b commit e51c9b4
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions chaste_codegen_sbml/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,20 +434,6 @@ def GetReactionFormula(n, model):

################################## NEW ######################################################

def GetReactionNames(model,string):

num_reactions = model.getNumReactions()

for i in range(num_reactions):
reaction = model.getReaction(i)
reaction_id= reaction.getId()
reaction_name = reaction.getName()
# if (reaction_name != ''):
# string = string.replace(reaction_id,reaction_name)

return string


def GetCompartmentNameCorrespondingToId(model,string):

compartment_id = string
Expand Down Expand Up @@ -511,8 +497,6 @@ def GetReactionString(model):

reactions_string += "\n"

reactions_string = GetReactionNames(model,reactions_string)

return reactions_string


Expand Down Expand Up @@ -668,9 +652,6 @@ def GetOdesString(model):
if( (species_id in odes_dict)&(not species.getBoundaryCondition()) ): #species defined by algebraic rules are not in odes_dict
species_ode = odes_dict[species_id] #Get the corresponding ode

######### EDITED #############
species_ode = GetReactionNames(model,species_ode)

# species = model.getSpecies(key)
compartment_id = species.getCompartment() #Get the corresponding compartment

Expand Down

0 comments on commit e51c9b4

Please sign in to comment.