From 35e3c34bc2621470edf4baec30da4dc0fc6ce7c0 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Tue, 29 Oct 2024 23:37:42 +0000 Subject: [PATCH 1/2] Implement getindex for UntypedVarInfo --- src/varinfo.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/varinfo.jl b/src/varinfo.jl index 11fe08d0f..37f72f30b 100644 --- a/src/varinfo.jl +++ b/src/varinfo.jl @@ -1694,6 +1694,7 @@ Return the current value(s) of the random variables sampled by `spl` in `vi`. The value(s) may or may not be transformed to Euclidean space. """ +getindex(vi::UntypedVarInfo, spl::Sampler) = copy(getindex(vi.metadata.vals, _getranges(vi, spl))) getindex(vi::VarInfo, spl::Sampler) = copy(getindex_internal(vi, _getranges(vi, spl))) function getindex(vi::TypedVarInfo, spl::Sampler) # Gets the ranges as a NamedTuple From 1384fa590d48552f164eb3de9021cda48e83cafb Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Thu, 31 Oct 2024 19:57:17 +0000 Subject: [PATCH 2/2] Format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/varinfo.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/varinfo.jl b/src/varinfo.jl index 37f72f30b..4cf1f1b02 100644 --- a/src/varinfo.jl +++ b/src/varinfo.jl @@ -1694,7 +1694,8 @@ Return the current value(s) of the random variables sampled by `spl` in `vi`. The value(s) may or may not be transformed to Euclidean space. """ -getindex(vi::UntypedVarInfo, spl::Sampler) = copy(getindex(vi.metadata.vals, _getranges(vi, spl))) +getindex(vi::UntypedVarInfo, spl::Sampler) = + copy(getindex(vi.metadata.vals, _getranges(vi, spl))) getindex(vi::VarInfo, spl::Sampler) = copy(getindex_internal(vi, _getranges(vi, spl))) function getindex(vi::TypedVarInfo, spl::Sampler) # Gets the ranges as a NamedTuple