Add joint multidimensional histograms, frequency views, and marginals - #109
Merged
Merged
Conversation
Add a docs-check build type that treats documentation warnings as errors. Run it in a dedicated Ubuntu job using stable DMD. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Change two-axis insertion from updating separate marginal counts to incrementing one joint bin. Support rectangular built-in arrays and rank-2 ndslices, validate storage shape, and resolve both coordinates before updating counts. Preserve one-axis behavior and reject unsupported joint flow bins, merging, and higher-dimensional configurations. Add documentation examples and regression coverage for storage ownership, strided slices, mixed coordinate types, and invalid inputs. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Store enabled underflow/overflow bins alongside ordinary joint counts, preserving both coordinates for edge and corner observations. Validate expanded storage dimensions and resolve both coordinates before updating counts. Add axis-specific underflow and overflow member functions that sum current joint counts, including the other axis's underflow/overflow bins. Preserve existing one-axis storage and accessors. Add documentation and regression coverage for underflow/overflow bin combinations, strided storage, boundary handling, invalid inputs, and const access. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Prefer DMD and focused tests during routine development, starting with the affected configuration for compiler-specific issues. Run the required compiler/build matrix once edits stabilize and reuse valid test results. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Support joint counting in ndslices and nested built-in arrays with one storage dimension per axis. Validate every dimension and resolve all coordinates before incrementing a count. Extend axis-specific underflow/overflow totals across the remaining dimensions while preserving storage strides and one-axis behavior. Add three-dimensional documentation examples and regression coverage for higher ranks, malformed storage, mixed coordinate types, and shared storage ownership. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Merge corresponding ordinary and underflow/overflow bins in N-dimensional histograms with matching axes and counter types. Validate axes and both storage shapes before changing counts. Support const sources and different built-in array and ndslice layouts without allocation. Preserve one-axis behavior and document the storage overlap contract. Add documentation and regression coverage for cross-layout merging, invalid shapes, self-merging, and read-only sources. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Generalize HistogramBin and HistogramBinView to expose per-axis indices and descriptions through index!dimension and bin!dimension, defaulting to axis zero. Traverse ordinary joint bins with the last axis advancing fastest, preserving storage strides, live counts, and original coordinates through slicing and independent cursors. Support borrowed views of static-array storage with compiler-dependent escape checking. Add documentation and regression coverage for mixed axes, const access, ownership, and invalid shapes. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Support multiple axes with one total update per joint observation, ordinary-bin frequency access, and per-axis underflow/overflow frequencies with selectable output types. Initialize totals from all storage and support merging compatible joint accumulators across storage layouts. Keep cumulative methods and frequency views one-dimensional. Add a documentation example and regression tests for joint counting, indexing, merging, and rejected inputs, including @safe/@nogc coverage. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Support ordinary-bin traversal across multiple axes with per-axis index and bin access, live counts and frequencies, and selectable output precision. Share bin-reading logic with histogram views while preserving frequency views' accumulator borrowing and DIP1000 protections. Add documentation and tests for joint traversal, strided storage, categorical axes, live updates, const cursors, and lifetime checks. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Store enabled underflow/overflow bins alongside ordinary bins in one-dimensional histograms, matching the joint histogram layout. Remove separate counters and consolidate insertion and merging. Add storageExtent accessors and update reference-counted factories to allocate the full storage size. Preserve ordinary-bin indexing in views and frequency access, and account for the unified layout in totals and cumulative frequencies. Update documentation and tests for storage sizing, prepopulated end counts, shared storage, and merges across layouts. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Add BinCoverage.all to histogram and frequency views, including joint underflow/overflow combinations and per-axis bin classification. Keep ordinary-only traversal as the default and guard access to ordinary-bin indices and descriptions. Expose count-only bins on FrequencyAccumulator alongside frequencyBins, preserving storage ownership and borrowing behavior. Add documentation examples and regression tests for coverage, live updates, strided storage, and lifetime protections. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Add marginal!(axes...) to histogram and frequency accumulators, preserving the selected axis order and summing all discarded-axis bins, including underflow/overflow bins. Use a shared internal projection routine for built-in arrays and strided Mir slices. Allocate independent reference-counted counts while preserving retained axes' boundary ownership semantics. Add documentation examples and regression tests for count conservation, axis selection, independent updates, allocation attributes, and lifetimes. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Use an unqualified CountType for count values and temporary sums while preserving const and immutable qualifiers on the underlying storage. Add regression tests for read-only histogram and frequency reductions, marginals, cumulative frequencies, and rejection of count mutation. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Move histogram and frequency marginal documentation tests alongside their accumulator examples, preserving simple-to-complex ordering. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Wrap assignment checks in statement blocks within __traits(compiles) and use named static-array types for .init expressions. Preserve the existing checks while addressing CircleCI parser errors. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Pass the source view by ref const to avoid an LDC 1.28.1 compiler crash and unnecessary reference-count operations. Extend regression coverage for cursor independence and ownership of saved/sliced views. AI-Assisted-By: Codex (GPT-6 Astra Medium)
jmh530
marked this pull request as ready for review
September 16, 2026 03:53
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #109 +/- ##
============================================
- Coverage 100.00% 42.12% -57.88%
============================================
Files 39 7 -32
Lines 6270 235 -6035
============================================
- Hits 6270 99 -6171
- Misses 0 136 +136 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Replace independent per-axis counting with joint multidimensional histograms. For example,
put(temperature, pressure)now increments one bin representing that coordinate pair.Changes
marginal!(axes...)()to both accumulators, producing independent reference-counted counts by summing over discarded axes.API changes
countsincludes enabled underflow/overflow bins in each dimension.put(x, y, ...)records one joint observation. One-axis variadic insertion continues to record separate observations.index!dimensionandbin!dimension, defaulting to dimension zero.bins()returns descriptions and counts;frequencyBins()also returns relative frequencies. Both default to ordinary bins and supportBinCoverage.all.Marginals include underflow/overflow counts from discarded axes and preserve the selected axes in the requested order. Count storage is independently owned; borrowed axis boundaries remain borrowed.
Validation