Repository navigation
Use values-first ordering across weighted statistical APIs - #183
Merged
jmh530 merged 1 commit intoOct 19, 2026
Merged
Conversation
Align weighted quantiles and histogram APIs with weighted means and sums: observation inputs precede weights, followed by axis or probability configuration. Custom-allocation factories retain the allocator as their first argument. Apply the convention to weighted histogram and relative-frequency construction, percentograms, quantile axes, and incremental updates. Multidimensional calls place every coordinate before the weight; weighted sample updates take sample, coordinates, then weight. Preserve reference forwarding and existing storage ownership. Update internal callers, shared test adapters, examples, and documentation together. Cover same-typed asymmetric quantile inputs that distinguish observations from weights, and retain the expected results throughout the migrated histogram tests. This intentionally breaks existing weight-first calls. Callers must reorder arguments even when their types still permit compilation. Statistical algorithms and weight semantics remain unchanged. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Weighted quantiles and histogram APIs previously placed weights before observations, unlike weighted means and sums. This change establishes consistent ordering: observation inputs first, weights next, and axis or probability configuration afterward. Custom-allocation factories retain the allocator as their first argument.
The convention applies to weighted quantiles, histogram and relative-frequency construction, percentograms, quantile axes, and incremental updates. Multidimensional calls place all coordinates before weights:
weightedQuantile(values, weights, probabilities)weightedHistogram(x, y, weights, xAxis, yAxis)h.putWeighted(x, y, weight)h.putWeightedSample(sample, x, y, weight)weightedHistogram!Cell(samples, x, y, weights, xAxis, yAxis)Internal callers, shared test adapters, examples, and documentation are updated together. Statistical algorithms, weight semantics, and storage ownership remain unchanged.
Compatibility
This intentionally breaks existing weight-first calls. Callers must reorder arguments even when matching argument types still allow the old calls to compile. Regression coverage uses asymmetric, same-typed observations and weights to distinguish the two orderings.
Validation
The final review correction changed only an example comment; executable code was unchanged after these tests.
AI-Assisted-By: Codex (GPT-6 Astra Medium)