question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: 't_span' is illustrated as 2-tuple of floats in scipy‘s documention, but which is always defined as array_like in examples

See original GitHub issue

Describe your issue.

https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html#scipy.integrate.solve_ivp

We can notice that ‘t_span’ is illustrated as 2-tuple of floats in scipy‘s documention.

t_span: 2-tuple of floats Interval of integration (t0, tf). The solver starts with t=t0 and integrates until it reaches t=tf.

Then, the example is show below.

from scipy.integrate import solve_ivp

def exponential_decay(t, y): return -0.5 * y

sol = solve_ivp(exponential_decay, [0, 10], [2, 4, 8])

print(sol.t)

However, in third line of the above paragraph ,we use [0, 10] as ‘t_sapn’, which is array_like.

Reproducing Code Example

from scipy.integrate import solve_ivp
def exponential_decay(t, y): return -0.5 * y
sol = solve_ivp(exponential_decay, [0, 10], [2, 4, 8])
print(sol.t)

Error message

t_span2-tuple of floats
Interval of integration (t0, tf). The solver starts with t=t0 and integrates until it reaches t=tf.

SciPy/NumPy/Python version information

1.9.1 1.23.1 sys.version_info(major=3, minor=10, micro=4, releaselevel=‘final’, serial=0)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tsinglinraincommented, Sep 8, 2022

Firstly thanks to your reply.

In fact, I don’t know anything about document modification on the web, and I’m afraid I can’t complete a PR. I am sorry.

0reactions
Femme-jscommented, Sep 21, 2022

Sure, Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Result from function call is not a proper array of floats
Your problem is that you have added comma after every f1 to f7 calculations. f2 = z1 - z0*const2, <-- remove these commas....
Read more >
integer overflow in scipy.sparse.sputils.check_shape ... - GitHub
This is due to overflow error when calculating size of the sparse matrix via np.prod, with datatype = int. Changing the datatype to...
Read more >
Floating Point Error - Allegro PCB Editor and PCB SKILL
I am trying to create NoProbeTop using skill language for the chip component. My code snippet is : thisNPTShape2 = axlDBCreateOpenShape(path ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found