Skip to content

Commit

Permalink
Merge pull request #142 from GillesPy2/hotfix-for-ssacsolver-issue
Browse files Browse the repository at this point in the history
Ordered dictionaries are better than dictionaries ; changed data stru…
  • Loading branch information
briandrawert authored Jun 25, 2019
2 parents 6a7893d + 95255b8 commit a761a15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gillespy2/core/gillespy2.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def sanitized_species_names(self):
later on by GillesPySolvers evaluating reaction propensity functions.
:return: the dictionary mapping user species names to their internal GillesPy notation.
"""
species_name_mapping = {}
species_name_mapping = OrderedDict([])
for i, name in enumerate(self.listOfSpecies.keys()):
species_name_mapping[name] = 'S[{}]'.format(i)
return species_name_mapping
Expand Down Expand Up @@ -235,7 +235,8 @@ def sanitized_parameter_names(self):
later on by GillesPySolvers evaluating reaction propensity functions.
:return: the dictionary mapping user parameter names to their internal GillesPy notation.
"""
parameter_name_mapping = {'vol': 'V'}
parameter_name_mapping = OrderedDict()
parameter_name_mapping['vol'] = 'V'
for i, name in enumerate(self.listOfParameters.keys()):
if name not in parameter_name_mapping:
parameter_name_mapping[name] = 'P{}'.format(i)
Expand Down

0 comments on commit a761a15

Please sign in to comment.