-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I'm trying to piggyback cmdstanr to read samples generated elsewhere. as_cmdstan_fit complains variable names such as "OMEGA(1,1)", whiledata.table::fread ingests fine. I think it's caused by the internal unpacking variable names.fread_cmd's grepping
To Reproduce
For a csv with content (dummy metadata)
# model = norm_model
# start_datetime = 2025-11-19 22:23:43 UTC
# method = sample (Default)
# sample
# ....
THETA4,"SIGMA(1,1)"
2.00000E+00,2.00000E+00
2.00000E+00,2.00000E+00
as_cmdstan_fit("foo.csv", check_diagnostics=FALSE) errors
Error in grep(pattern, var_names) :
invalid regular expression '^"SIGMA(1\[', reason 'Missing ')''
In addition: Warning message:
In grep(pattern, var_names) : TRE pattern compilation error 'Missing ')''Expected behavior
No error, as by fread:
fread(cmd="grep -v '^#' --color=never foo.csv")
THETA4 SIGMA(1,1)
<num> <num>
1: 2 2
2: 2 2Operating system
MacOS 15.7 (24G222) 11881.140.96
Ubuntu 24.04
CmdStanR version number
cmdstanr_0.9.0 & master 7c7b5d2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working