is_chain_list: return FALSE for empty lists #517
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #517 +/- ##
=======================================
Coverage 98.67% 98.67%
=======================================
Files 35 35
Lines 5903 5905 +2
=======================================
+ Hits 5825 5827 +2
Misses 78 78 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jgabry
left a comment
There was a problem hiding this comment.
Thanks. I don't actually think we need these replacements because most of the zero-length cases cannot possibly reach them. The one case I think is worth fixing is just erroring when is_chain_list is passed an empty list, but we can do that immediately before reaching sapply and without needing vapply (see review comment). The switch to vapply doesn't actually solve the problem in that case. So I would just make this PR into one fixing that one specific case.
0bb70dd to
f6cadb8
Compare
|
I think I accidentally reverted your changes, so I just pushed again to restore your changes. I think it's ready now |
Fixes #516
Summary
sapply()withvapply()across 5 filesvapply()enforces a declared return type, preventing silentlist()returns on zero-length input that can cause hard to diagnose downstream failuressapply(x, colnames)calls athelpers-mcmc.R:277,303are intentionally unchanged, they rely on flexible return types to detect mismatched column names across chains