Skip to content

Commit

Permalink
Update state-dependant example
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Jan 28, 2025
1 parent 8f8dd29 commit 86b4a94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
11 changes: 6 additions & 5 deletions examples/state_dependent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""


import numpy
import numpy as np

from jitcdde import jitcdde, t, y

Expand All @@ -22,8 +22,9 @@

DDE.integrate_blindly(0.01)

data = []
for time in [ DDE.t, *numpy.linspace(0.9,2,30) ]:
data.append([time, DDE.integrate(time)])
numpy.savetxt("timeseries.dat", data)
steps = np.linspace(0.9,2,30)
data = np.empty((steps.size + 1, 2))
for n, time in enumerate([ DDE.t, *steps ]):
data[n] = [time, DDE.integrate(time)[0]]
np.savetxt("timeseries.dat", data)

3 changes: 1 addition & 2 deletions tests/test_jitcdde.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

from jitcdde import (
UnsuccessfulIntegration,
_find_max_delay,
_get_delays,
input, # noqa: A004
jitcdde,
jitcdde_input,
Expand All @@ -19,6 +17,7 @@
test,
y,
)
from jitcdde._jitcdde import _find_max_delay, _get_delays


dirname = os.path.dirname(__file__)
Expand Down

0 comments on commit 86b4a94

Please sign in to comment.