Repository navigation
WEIBULL.DIST density is zero at zero - #3003
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Handle and verify zero input crates/functions/src/stat/distributions.rs, crates/functions/src/stat/tests.rs, docs/function-parity.md |
weibull_dist returns 0.0 at x=0 in both modes. Tests cover shape values 0.5, 1.0, and 2.0, results at x=1, and #NUM! for negative x. The parity document records these behaviors. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: dylanmtaylor, aiongg
Merge Risk: 
Minimal · up to 6d5ab
-
The change has no established merge-blocking correctness or availability risk.
Security architecture risk: 
Minimal · up to 6d5ab
-
The change is limited to returning zero from existing Weibull calculations. Argument conversion, invalid-input checks, function registrations, and positive-input calculations remain unchanged. No material security risk was identified.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — The demonstrated exposure remains numeric worksheet evaluation through the two existing names. The changed function ignores its evaluation context and only converts arguments, checks their numeric domain, performs arithmetic, and returns a value or error; the added branch does not introduce privileged or cross-service operations.
Trust Boundaries and Controls
- observed — The zero shortcut does not precede argument conversion or the existing rejection of negative x and nonpositive shape or scale. Comparing base and head shows these checks remain in the same order before the new return, so this branch does not bypass them.
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "WEIBULL.DIST density is zero at zero" matches the main change. The raw summary says weibull_dist now returns 0.0 when x == 0.0 in both cumulative and density modes, and the PR objectives state the same goal, including shapes below one. The title names the function and the behavior, and it is short and specific. It does not mention the cumulative-mode change, but the title does not need to cover every detail.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 1
- Waived: $0.25 (charged $0.00)
- View usage details
Note
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
Comment @coderabbitai help to get the list of available commands.
|
Landed in main (fb1e59f). Thank you for the contribution, @Harrison-Booth! |
Summary
WEIBULL.DISTat x=0 for both density and cumulative modes, including shapes below one.Validation
cargo fmt --all -- --checkandgit diff --checkpass.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
WEIBULL.DISTnow returns zero for both density and cumulative calculations whenxis zero, including for shape values below one. This makes the result consistent across supported shape values. Negativexcontinues to return#NUM!.Documentation
WEIBULL.DISTbehavior at zero and for negative inputs.