Skip to content

Commit

Permalink
Merge pull request #182 from jmuhlich/matlab_exporter_species
Browse files Browse the repository at this point in the history
Fix species name fixup in matlab exporter
  • Loading branch information
jmuhlich committed Nov 30, 2015
2 parents f8a0adf + e4af380 commit 21c8ae7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pysb/export/matlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ def export(self):
# Flatten to a string and add correct indentation
odes_str = ('\n'+' '*12).join(odes_species_list)

# Change species names from, e.g., 's(0)' to 'y0(1)' (note change
# Change species names from, e.g., '__s(0)' to 'y0(1)' (note change
# from zero-based indexing to 1-based indexing)
odes_str = re.sub(r's(\d+)', \
odes_str = re.sub(r'__s(\d+)', \
lambda m: 'y0(%s)' % (int(m.group(1))+1), odes_str)
# Change C code 'pow' function to MATLAB 'power' function
odes_str = re.sub(r'pow\(', 'power(', odes_str)
Expand Down

0 comments on commit 21c8ae7

Please sign in to comment.