Skip to content

Commit 1f1f976

Browse files
committed
ParTable(graph): group is only valid for ensemble
1 parent 91a149d commit 1f1f976

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/frontend/specification/StenoGraphs.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function ParameterTable(
3636
observed_vars::AbstractVector{Symbol},
3737
latent_vars::AbstractVector{Symbol},
3838
params::Union{AbstractVector{Symbol}, Nothing} = nothing,
39-
group::Integer = 1,
39+
group::Union{Integer, Nothing} = nothing,
4040
param_prefix = ,
4141
)
4242
graph = unique(graph)
@@ -69,7 +69,17 @@ function ParameterTable(
6969
end
7070
if element isa ModifiedEdge
7171
for modifier in values(element.modifiers)
72-
modval = modifier.value[group]
72+
if isnothing(group) &&
73+
modifier.value isa Union{AbstractVector, Tuple} &&
74+
length(modifier.value) > 1
75+
throw(
76+
ArgumentError(
77+
"The graph contains a group of parameters, ParameterTable expects a single value.\n" *
78+
"For SEM ensembles, use EnsembleParameterTable instead.",
79+
),
80+
)
81+
end
82+
modval = modifier.value[something(group, 1)]
7383
if modifier isa Fixed
7484
if modval == :NaN
7585
free[i] = true

0 commit comments

Comments
 (0)