mattja / sdeint

Numerical integration of Ito or Stratonovich SDEs
GNU General Public License v3.0
154 stars 25 forks source link

Give a more helpful error message if f returns an array with more than 1 dimension #6

Open mattja opened 7 years ago

mattja commented 7 years ago

sdeint needs some tighter input validation, if people try to use a state vector y with shape (n,1) instead of (n,) e.g. mattja/nsim#2

I see that scipy.integrate.odeint also refuses this kind of input. But it gives a proper error message:

RuntimeError: The array return by func must be one-dimensional, but got ndim=2.