Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate sites support #410

Merged
merged 10 commits into from May 10, 2019

Revert parameter precision formatting changes

  • Loading branch information...
alubbock committed Apr 25, 2019
commit e30d0cbbab77c16eb3fd29d8f558ec27451a8a44
@@ -519,8 +519,7 @@ def set_parameter(self, name, value):
Value of parameter
"""
self.command_queue.write('\tsetParameter("%s", %.17g)\n'
% (name, value))
self.command_queue.write('\tsetParameter("%s", %g)\n' % (name, value))

def set_concentration(self, cplx_pat, value):
"""
@@ -540,8 +539,8 @@ def set_concentration(self, cplx_pat, value):
formatted_name = format_complexpattern(
pysb.core.as_complex_pattern(cplx_pat)
)
self.command_queue.write('\tsetConcentration("%s", %.17g)\n'
% (formatted_name, value))
self.command_queue.write('\tsetConcentration("%s", %g)\n' % (
formatted_name, value))


def generate_hybrid_model(model, population_maps, additional_species=None,
@@ -46,7 +46,7 @@ def generate_parameters(self):
max_length = max(len(p.name) for p in
self.model.parameters | self.model.expressions)
for p in self.model.parameters:
self.__content += ((" %-" + str(max_length) + "s %.17g\n") %
self.__content += ((" %-" + str(max_length) + "s %e\n") %
(p.name, p.value))
for e in exprs:
self.__content += ((" %-" + str(max_length) + "s %s\n") %
@@ -49,7 +49,7 @@ def generate_content(self):

def generate_parameters(self):
for p in self.model.parameters:
self.__content += "%%var: '%s' %.17g\n" % (p.name, p.value)
self.__content += "%%var: '%s' %e\n" % (p.name, p.value)
for e in self.model.expressions:
str_expr = str(expression_to_muparser(e))
self.__content += "%%var: '%s' %s\n" % (e.name, str_expr)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.