sys-bio / roadrunner

libRoadRunner: A high-performance SBML simulator
http://libroadrunner.org/
Other
39 stars 24 forks source link

When printing the integrator the name of the integrator is missing #285

Closed matthiaskoenig closed 8 years ago

matthiaskoenig commented 8 years ago

When printing the integrator, the r.integrator.getName() is not displayed. You should be able to tell which integrator it is by printing it.

import tellurium as te
r = te.loada('S1 -> S2; k1*S1; k1 = 0.1; S1 = 40')
print(r.integrator)
< roadrunner.Integrator() >
  settings:
      relative_tolerance: 0.00001
      absolute_tolerance: 0.0000000001
                   stiff: true
       maximum_bdf_order: 5
     maximum_adams_order: 12
       maximum_num_steps: 20000
       maximum_time_step: 0
       minimum_time_step: 0
       initial_time_step: 0
          multiple_steps: false
      variable_step_size: false

In addition: How can I get an integrator by name to set a setting? Currently I have to do the workaround

prev = self.integrator.getName()
self.setIntegrator('gillespie')
self.integrator.setValue('seed', float(seed))
self.setIntegrator(prev)

There should be something like self.getIntegrator('gillespie') to get the integrator object and be able to set something, without having to set it as as integrator.

0u812 commented 8 years ago

I can add RoadRunner.getIntegratorByName(self, integratorName) to get the integrator by name, and a helper method RoadRunner.setIntegratorSetting(self, integratorName, settingName, value) as a shorthand for setting parameters.

matthiaskoenig commented 8 years ago

Yes, this these two methods solve the issue.

On Sat, Feb 6, 2016 at 2:44 AM, Kyle Medley notifications@github.com wrote:

Closed #285 https://github.com/sys-bio/roadrunner/issues/285 via 5fdb07c https://github.com/sys-bio/roadrunner/commit/5fdb07c7ededc601907d371fa6bdae59739727ee .

— Reply to this email directly or view it on GitHub https://github.com/sys-bio/roadrunner/issues/285#event-541510014.

Matthias König Email: konigmatt@googlemail.com Tel: + 49 30 20938450 Tel: + 49 176 81168480 https://www.livermetabolism.com/contact.html Humboldt-University Berlin, Institute for Theoretical Biology, Junior Group König Charité Berlin, Institute of Biochemistry, Computational Systems Biochemistry http://www.charite.de/sysbio/people/koenig/

matthiaskoenig commented 8 years ago

Integrator name still not printed in string output.

print(r.integrator)

< roadrunner.Integrator() >
  settings:
      relative_tolerance: 0.00001
      absolute_tolerance: 0.0000000001
                   stiff: true
       maximum_bdf_order: 5
     maximum_adams_order: 12
       maximum_num_steps: 20000
       maximum_time_step: 0
       minimum_time_step: 0
       initial_time_step: 0
          multiple_steps: false
      variable_step_size: false