Skip to content

Commit 3bb6965

Browse files
committed
Only use SummaryStats' public API
1 parent 9086c46 commit 3bb6965

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/posteriorstats.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using InferenceObjects
44
using PosteriorStats
55
using Statistics
66
using StatsBase
7+
using Tables
78
using Test
89

910
_as_array(x) = fill(x)
@@ -262,9 +263,10 @@ _as_array(x::AbstractArray) = x
262263

263264
stats = @inferred SummaryStats summarize(data, mean, std; name="Stats")
264265
@test stats.name == "Stats"
265-
@test stats[:label] == var_names
266-
@test stats[:mean] map(mean, slices)
267-
@test stats[:std] map(std, slices)
266+
stats_nt = Tables.columntable(stats)
267+
@test stats_nt.label == var_names
268+
@test stats_nt.mean map(mean, slices)
269+
@test stats_nt.std map(std, slices)
268270

269271
stats_def = summarize(arr; var_names)
270272
@test summarize(data) == stats_def

0 commit comments

Comments
 (0)