Skip to content

Commit 9055986

Browse files
author
Frankie Robertson
committed
Remove dependency upon ResumableFunctions
1 parent cc964ef commit 9055986

File tree

5 files changed

+24
-38
lines changed

5 files changed

+24
-38
lines changed

Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ PrecompileTools = "1.2.1"
6262
PsychometricsBazaarBase = "^0.8.1"
6363
Random = "^1.11"
6464
Reexport = "1"
65-
ResumableFunctions = "^0.6, 1"
6665
Setfield = "^1"
6766
SparseArrays = "^1.11"
6867
StaticArrays = "1"
@@ -75,8 +74,7 @@ julia = "^1.11"
7574
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
7675
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
7776
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
78-
ResumableFunctions = "c5292f4c-5179-55e1-98c5-05642aab7184"
7977
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8078

8179
[targets]
82-
test = ["Aqua", "JET", "Optim", "ResumableFunctions", "Test"]
80+
test = ["Aqua", "JET", "Optim", "Test"]

test/compat.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using ComputerAdaptiveTesting.ItemBanks: LogItemBank
1212
using ComputerAdaptiveTesting.NextItemRules: best_item
1313
using ComputerAdaptiveTesting: Compat
14-
using ResumableFunctions
1514
using Test: @test, @testset
1615

1716
#include("./dummy.jl")

test/dummy.jl

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ using PsychometricsBazaarBase.Integrators
1010
using PsychometricsBazaarBase.Optimizers
1111
using Optim
1212
using Random
13-
using ResumableFunctions
1413

1514
struct DummyAbilityEstimator <: AbilityEstimator
1615
val::Any
@@ -24,7 +23,7 @@ const optimizers_1d = [
2423
FunctionOptimizer(OneDimOptimOptimizer(-6.0, 6.0, NelderMead()))
2524
]
2625
const integrators_1d = [
27-
FunctionIntegrator(QuadGKIntegrator(-6, 6, 5)),
26+
FunctionIntegrator(QuadGKIntegrator(lo=-6.0, hi=6.0, order=5)),
2827
FunctionIntegrator(FixedGKIntegrator(-6, 6, 80))
2928
]
3029
const ability_estimators_1d = [
@@ -46,47 +45,39 @@ const criteria_1d = [
4645
((), (stuff) -> RandomNextItemRule())
4746
]
4847

49-
@resumable function _get_stuffs(needed)
48+
function _get_stuffs(needed)
5049
if :est in needed
51-
for (extra_needed, mk_est) in ability_estimators_1d
50+
return (
51+
(; stuff..., est = mk_est(stuff))
52+
for (extra_needed, mk_est) in ability_estimators_1d
5253
for stuff in _get_stuffs(setdiff(needed, Set((:est,))) extra_needed)
53-
x = (; stuff..., est = mk_est(stuff))
54-
@yield x
55-
end
56-
end
57-
return
54+
)
5855
end
5956
if :integrator in needed
60-
for new_integrator in integrators_1d
57+
return (
58+
(; stuff..., integrator = new_integrator)
59+
for new_integrator in integrators_1d
6160
for stuff in _get_stuffs(setdiff(needed, Set((:integrator,))))
62-
x = (; stuff..., integrator = new_integrator)
63-
@yield x
64-
end
65-
end
66-
return
61+
)
6762
end
6863
if :optimizer in needed
69-
pop!(needed, :optimizer)
70-
for new_optimizer in optimizers_1d
64+
return (
65+
(; stuff..., optimizer = new_optimizer)
66+
for new_optimizer in optimizers_1d
7167
for stuff in _get_stuffs(setdiff(needed, Set((:optimizer,))))
72-
x = (; stuff..., optimizer = new_optimizer)
73-
@yield x
74-
end
75-
end
76-
return
68+
)
7769
end
78-
x = NamedTuple()
79-
@yield x
80-
return
70+
return [NamedTuple()]
8171
end
8272

83-
@resumable function get_stuffs(needed)
84-
add_dummy_est = !(:est in needed)
85-
for stuff in _get_stuffs(needed)
86-
if add_dummy_est
87-
stuff = (; stuff..., est = DummyAbilityEstimator(0.0))
88-
end
89-
@yield stuff
73+
function get_stuffs(needed)
74+
if !(:est in needed)
75+
return (
76+
(; stuff..., est = DummyAbilityEstimator(0.0))
77+
for stuff in _get_stuffs(needed)
78+
)
79+
else
80+
return _get_stuffs(needed)
9081
end
9182
end
9283

test/runtests.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ using Distributions
1717
using Distributions: ZeroMeanIsoNormal, Zeros, ScalMat
1818
using Optim
1919
using Random
20-
using ResumableFunctions
2120

2221
using Test
2322

test/stateful.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using ComputerAdaptiveTesting.NextItemRules: RandomNextItemRule
88
using ComputerAdaptiveTesting: Stateful
99
using ComputerAdaptiveTesting: require_testext
10-
using ResumableFunctions
1110
using Test: @test, @testset
1211

1312
include("./dummy.jl")

0 commit comments

Comments
 (0)