neurophysik / jitcdde

Just-in-time compilation for delay differential equations
Other
57 stars 14 forks source link

mute warnings #26

Closed ggrrll closed 4 years ago

ggrrll commented 5 years ago

Hi,

can you please explain where UserWarning: The target time is smaller than the current time. comes from and how we can mute it?

(as I am running a fit, the optimizer spit it out a huge amount of times, making the jupyter notebook very heavy...)

Thanks

ps: I am on mac os, with jitcdde.__version__ = 1.5.0

ggrrll commented 5 years ago

ok,

I see that integrate_blindly removes the warnings indeed

ggrrll commented 5 years ago

...actually, would be useful also to mute

https://github.com/neurophysik/jitcdde/blob/926bc6852e3d5e7e5d4b7f586a4be2cab8c85e2e/jitcdde/_jitcdde.py#L521

as well as Generating, compiling, and loading C code.

Wrzlprmft commented 5 years ago

JiTCDDE has an internal “integrator time”, which is simply as much as is already integrated (or provided as an initial past). JiTCDDE’s integrate doesn’t just make the integrator time match the target time (like most ODE integrators). Instead, it integrates in adaptive steps (controlling the integration error) until the integrator time exceeds the target time and then interpolates the result from the last step. If integrate’s target time is already lower than the integrator time (when integrate is called), the above warning is thrown.

This warning is thrown to warn users try to integrate “backwards” accidentally or due to a misunderstanding. It may also be thrown when you call integrate with a target time that is very close (in which case your sampling interval may be smaller than necessary, but that just means more data). Due to the way JiTCDDE works, it is not possible to reliably distinguish these cases.

All warnings are thrown with the warnings module and you can use it to control them. For example, you can deactivate all warnings with:

import warnings                                                        
warnings.simplefilter("ignore")

It is usually not a good idea to use integrate_blindly instead, since this will not have any step-size control, which may yield an overly large integration error.

All status reports can be silenced with the argument verbose=False when initialising jitcdde.

ggrrll commented 4 years ago

ok thanks!

-- I am new to DDEs, so I will try to be careful to what's happening indeed during the integration..