fix standalone generated quantities csv writer - #3404
Conversation
There was a problem hiding this comment.
Besides fixing the merge conflict, mind also adding a test that you can get the exact same result from both overloads now?
There was a problem hiding this comment.
That test was already waiting and now included
Jenkins Console Log Machine informationNo LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focalCPU: G++: Clang: |
78a1a90 to
01d2aba
Compare
|
Rebased onto develop now that #3402 has merged (force-pushed). Changes since this PR was opened:
The fix in |
Fixes #3403
The fix and PR text were assisted by Claude
Submission Checklist
./runTests.py src/test/unitmake cpplintSummary
gq_writer::write_gq_valueshas two overloads; thestd::vectorone drops the firstnum_constrained_params_valuesbefore writing, the Eigen one wrote everything
write_arrayreturned.The multi-chain path of
standalone_generateuses the Eigen overload,so
generate_quantities num_chains=Nproduced rows with the constrainedparameters prepended and a header listing only the generated quantities.
Intended Effect
Multi-chain standalone
generate_quantitieswrites one value per headername, matching the single-chain path.
How to Verify
./runTests.py src/test/unit/services/sample/standalone_gqs_parallel_test.cppNew test
genDraws_bernoulli_multi_chain_column_count: for a two-chainrun, every row must have as many comma-separated fields as the header
has names. Fails on develop, passes with this PR.
Command line:
gq_1.csvrows go fromtheta_value, u_valuetou_value.One further test is not included here. Once #3402 is
merged I will rebase and add
genDraws_bernoulli_multi_chain_matches_single, which asserts thatchain i of a multi-chain run reproduces a single-chain run with chain
id
1 + i. It needs both #3402 and this PR for the columnalignment.
Side Effects
Output change:
generate_quantities num_chains=Nloses the spuriousleading parameter columns. Anyone whose reader adapted to the current
(header-inconsistent) layout will need to drop the workaround.
Not addressed here: the same two paths disagree on the CSV separator
(
", "from the Eigen writer,","from the other). Cosmetic, andfixing it means touching the writer classes, which are shared with other
methods.
Documentation
None.
Copyright and Licensing
Aki Vehtari
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: