Skip to content

Commit 0e088b5

Browse files
authored
Merge pull request #277 from SciML/jd/datastructures_patch
datastructures patch
2 parents 659de1c + 3863810 commit 0e088b5

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ os:
33
- osx
44
- linux
55
julia:
6-
- 1.3
7-
- 1.4
6+
- 1.5
87
- nightly
98
matrix:
109
allow_failures:

Project.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Sundials"
22
uuid = "c3572dad-4567-51f8-b174-8c6c989267f4"
33
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]
4-
version = "4.2.6"
4+
version = "4.3.0"
55

66
[deps]
77
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
@@ -16,11 +16,11 @@ Sundials_jll = "fb77eaff-e24c-56d4-86b1-d163f2edb164"
1616

1717
[compat]
1818
CEnum = "0.2, 0.3, 0.4"
19-
DataStructures = "0.17.0, 0.18"
20-
DiffEqBase = "6.21"
19+
DataStructures = "0.18"
20+
DiffEqBase = "6.44"
2121
Reexport = "0.2"
2222
Sundials_jll = "5.2"
23-
julia = "1.3"
23+
julia = "1"
2424

2525
[extras]
2626
DiffEqOperators = "9fdde737-9c7f-55bf-ade8-46b3f136cc48"

src/common_interface/integrator_types.jl

+4-3
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ DiffEqBase.postamble!(integrator::AbstractSundialsIntegrator) = nothing
155155

156156
@inline function DiffEqBase.step!(integrator::AbstractSundialsIntegrator)
157157
if integrator.opts.advance_to_tstop
158-
while integrator.tdir*(integrator.t-DataStructures.top(integrator.opts.tstops)) < -1e6eps()
159-
tstop = DataStructures.top(integrator.opts.tstops)
158+
# The call to first is an overload of Base.first implemented in DataStructures
159+
while integrator.tdir*(integrator.t-first(integrator.opts.tstops)) < -1e6eps()
160+
tstop = first(integrator.opts.tstops)
160161
set_stop_time(integrator,tstop)
161162
integrator.tprev = integrator.t
162163
if !(typeof(integrator.opts.callback.continuous_callbacks)<:Tuple{})
@@ -174,7 +175,7 @@ DiffEqBase.postamble!(integrator::AbstractSundialsIntegrator) = nothing
174175
integrator.uprev .= integrator.u
175176
end
176177
if !isempty(integrator.opts.tstops)
177-
tstop = DataStructures.top(integrator.opts.tstops)
178+
tstop = first(integrator.opts.tstops)
178179
set_stop_time(integrator,tstop)
179180
solver_step(integrator,tstop)
180181
else

src/common_interface/integrator_utils.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ function DiffEqBase.savevalues!(integrator::AbstractSundialsIntegrator,force_sav
3838
saved, savedexactly = false, false
3939
!integrator.opts.save_on && return saved, savedexactly
4040
uType = eltype(integrator.sol.u)
41+
# The call to first is an overload of Base.first implemented in DataStructures
4142
while !isempty(integrator.opts.saveat) &&
42-
integrator.tdir*DataStructures.top(integrator.opts.saveat) < integrator.tdir*integrator.t
43+
integrator.tdir*first(integrator.opts.saveat) < integrator.tdir*integrator.t
4344
saved = true
4445
curt = pop!(integrator.opts.saveat)
4546

src/common_interface/solve.jl

+4-3
Original file line numberDiff line numberDiff line change
@@ -1153,8 +1153,9 @@ function DiffEqBase.solve!(integrator::AbstractSundialsIntegrator)
11531153
while !isempty(integrator.opts.tstops)
11541154
# Sundials can have floating point issues approaching a tstop if
11551155
# there is a modifying event each
1156-
while integrator.tdir*(integrator.t-DataStructures.top(integrator.opts.tstops)) < -1e6eps()
1157-
tstop = DataStructures.top(integrator.opts.tstops)
1156+
# The call to first is an overload of Base.first implemented in DataStructures
1157+
while integrator.tdir*(integrator.t-first(integrator.opts.tstops)) < -1e6eps()
1158+
tstop = first(integrator.opts.tstops)
11581159
set_stop_time(integrator,tstop)
11591160
integrator.tprev = integrator.t
11601161
if !(typeof(integrator.opts.callback.continuous_callbacks)<:Tuple{})
@@ -1217,7 +1218,7 @@ end
12171218
function handle_tstop!(integrator::AbstractSundialsIntegrator)
12181219
tstops = integrator.opts.tstops
12191220
if !isempty(tstops)
1220-
if integrator.tdir*(integrator.t-DataStructures.top(integrator.opts.tstops)) > -1e6eps()
1221+
if integrator.tdir*(integrator.t-first(integrator.opts.tstops)) > -1e6eps()
12211222
pop!(tstops)
12221223
t = integrator.t
12231224
integrator.just_hit_tstop = true

0 commit comments

Comments
 (0)