Fix week() calculation to start week 1 at days 1–7#7274
Fix week() calculation to start week 1 at days 1–7#7274
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7274 +/- ##
==========================================
+ Coverage 99.10% 99.12% +0.02%
==========================================
Files 84 85 +1
Lines 16128 16648 +520
==========================================
+ Hits 15983 16503 +520
Misses 145 145 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Generated via commit 3e8b9b7 Download link for the artifact containing the test results: ↓ atime-results.zip
|
|
@venom1204 please resolve conflicts @MichaelChirico can you please review because you posted the issue this fixes? |
…o issue____2611
|
@tdhock done |
|
Doesn't LGTM because it is a breaking change, not even documented. Maybe we can detect breaking behavior and raise warning that can be suppressed with a temporary global option? |
* rolling median * keep lint-c happy * try skip lint here * codecov * Apply wording suggestions from @mcol code review Co-authored-by: Marco Colombo <m.colombo@ed.ac.uk> * solve unreached codecov lines by raising warning * Revert "solve unreached codecov lines by raising warning" This reverts commit 34af12e. * codecov edge cases not reached before --------- Co-authored-by: Marco Colombo <m.colombo@ed.ac.uk>
* zeros and num stability * frollprod adaptive fast redirect to exact * more tests * codecov * correct expected ans * Revert "zeros and num stability" This reverts commit 4074e12. * handle zeros in frollprod fast
* pointer type changes + replace if with switch * Update src/reorder.c --------- Co-authored-by: Benjamin Schwendinger <52290390+ben-schwen@users.noreply.github.com>
* Changed many function calls to use read only variants when appropriate * implemented improvements as requested * minor update
* frollvar and frollsd * export * news entry for var and sd * codecov fix * handle var < 0 spotted by Ben * elaborate more on fall back to slow when NAs are in the input * align to changes proposed in #7376 * reuse existing macro as per Ben suggestion
|
@venom1204 Can you please add this breaking and raise the warning when mixed weeks arise? E.g. calculate both weeks (old + new formula) and warn when there is a mismatch? |
* implement comment.char argument for fread * remove handling of comment.char=NULL * update NEWS * update tests * change wording for error * remove unreachable code * add helper function * extend tests * update tests * use skip_line helper * add comments for helpers * fix test numbering * add more tests * simplify read * Revert "simplify read" This reverts commit a0a9525. * separate helpers * add comments * add coverage * simplify header handling * increase coverage * simplify code * control skipping white spaces before comments with strip.white * tighten helper * try improving readability with blank lines * include some line-end comments in the multi-line comment test * match read.table for na.strings and comment.char * add strip.white=FALSE header testcase * refactor end_of_field helper into more readable version * add example for strip.white * summarize line-skipping behavior * clean up tmp * don't introduce whitespace to string literal body --------- Co-authored-by: Michael Chirico <chiricom@google.com>

closes #2611
This PR fixes the long-standing bug in week() (#2611) by defining weeks sequentially: days 1–7 are week 1, days 8–14 week 2, etc.
hi @MichaelChirico @tdhock can you please have a review when you got time .
thanks.