Skip to content

Commit 33a84c7

Browse files
committed
reverted merge with torfjelde/extract-realizations
1 parent af64356 commit 33a84c7

File tree

4 files changed

+1
-208
lines changed

4 files changed

+1
-208
lines changed

docs/src/api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,6 @@ Sometimes it can be useful to extract the priors of a model. This is the possibl
143143
extract_priors
144144
```
145145

146-
Safe extraction of values from a given [`AbstractVarInfo`](@ref) as they are seen in the model can be done using [`values_as_in_model`](@ref).
147-
148-
```@docs
149-
values_as_in_model
150-
```
151-
152146
```@docs
153147
NamedDist
154148
```

src/DynamicPPL.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export AbstractVarInfo,
9393
getargnames,
9494
generated_quantities,
9595
extract_priors,
96-
values_as_in_model,
9796
# Samplers
9897
Sampler,
9998
SampleFromPrior,
@@ -179,7 +178,6 @@ include("transforming.jl")
179178
include("logdensityfunction.jl")
180179
include("model_utils.jl")
181180
include("extract_priors.jl")
182-
include("values_as_in_model.jl")
183181

184182
if !isdefined(Base, :get_extension)
185183
using Requires

src/values_as_in_model.jl

Lines changed: 0 additions & 181 deletions
This file was deleted.

test/model.jl

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ is_typed_varinfo(varinfo::DynamicPPL.SimpleVarInfo{<:NamedTuple}) = true
356356
]
357357
@testset "$(model.f)" for model in models_to_test
358358
vns = DynamicPPL.TestUtils.varnames(model)
359-
example_values = DynamicPPL.TestUtils.rand_prior_true(model)
359+
example_values = DynamicPPL.TestUtils.rand(model)
360360
varinfos = filter(
361361
is_typed_varinfo,
362362
DynamicPPL.TestUtils.setup_varinfos(model, example_values, vns),
@@ -375,22 +375,4 @@ is_typed_varinfo(varinfo::DynamicPPL.SimpleVarInfo{<:NamedTuple}) = true
375375
end
376376
end
377377
end
378-
379-
@testset "values_as_in_model" begin
380-
@testset "$(model.f)" for model in DynamicPPL.TestUtils.DEMO_MODELS
381-
vns = DynamicPPL.TestUtils.varnames(model)
382-
example_values = DynamicPPL.TestUtils.rand_prior_true(model)
383-
varinfos = DynamicPPL.TestUtils.setup_varinfos(model, example_values, vns)
384-
@testset "$(short_varinfo_name(varinfo))" for varinfo in varinfos
385-
realizations = values_as_in_model(model, varinfo)
386-
# Ensure that all variables are found.
387-
vns_found = collect(keys(realizations))
388-
@test vns vns_found == vns vns_found
389-
# Ensure that the values are the same.
390-
for vn in vns
391-
@test realizations[vn] == varinfo[vn]
392-
end
393-
end
394-
end
395-
end
396378
end

0 commit comments

Comments
 (0)