Skip to content

Commit 344965c

Browse files
authored
Fix handling of unconventional variable names (#97)
1 parent 1be3ebd commit 344965c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/ParetoSmoothDynamicPPLExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function ParetoSmooth.pointwise_log_likelihoods(model::DynamicPPL.Model, chains:
3737
# Size of array (n_steps, n_chains) using first parameter
3838
dims = size(last(first(log_like_dict)))
3939
# parse "var[i]" -> i
40-
ind_from_string(x) = parse(Int, split(split(x, "[")[2], "]")[1])
40+
ind_from_string(x) = parse(Int, rsplit(rsplit(x, "[", limit=2)[2], "]", limit=2)[1])
4141
# collect variable names
4242
sorted_keys = sort(collect(keys(log_like_dict)); by=ind_from_string)
4343
# Convert from dictionary to 3d array

0 commit comments

Comments
 (0)