jrleeman / rsfmodel

Rate and state frictional solver
MIT License
31 stars 12 forks source link

Integrator Argument Passing #9

Closed jrleeman closed 9 years ago

jrleeman commented 9 years ago

Allows passing of arguments to the integrator through the solve method. This is useful for things like setting the max step size (hmax) on problems that are particularly unstable. Resolves #5

dopplershift commented 9 years ago

My only question would be whether you still want abserr and relerr to be attributes on the class, or whether they should go through the same mechanism. You could set defaults if they're not passed in:

odeint_kwargs = dict(rtol=1e-12, atol=1e-12)
odeint_kwargs.update(kwargs)

si.odenit(..., **odeint_kwargs)

So the args start with the defaults, then are overridden by any that are passed in.

jrleeman commented 9 years ago

Ah. I was wondering what the best way to handle that is. I implemented it in the last push. Also fixed some of my bad spacing issues. How does this look?

dopplershift commented 9 years ago

Looks like someone pep8/flake8 -ed the code. :)

Everything looks good to me.

jrleeman commented 9 years ago

Yeah, I was bad about that. Will have to do some more cleaning as things get finalized. Some one the lines are pushing 110 chars.

dopplershift commented 9 years ago

I extended the limit to 90/95 characters in my projects, though I try to keep shorter.