Repository navigation
Conversation
Move statType and its existing tests into mir.math.internal.stat_type. Update product type deduction to import the helper directly, removing its dependency on mir.math.stat. Preserve the package-visible statType import through mir.math.stat and register the new internal module in the Meson source list. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Use Summator directly in the moving-average example, deriving the observation count from its fixed-size circular buffer. Define local averages using summation and element counts in the ndslice examples. Preserve their demonstrations and expected results without importing the statistics APIs planned for deprecation. AI-Assisted-By: Codex (GPT-6 Astra Medium)
Deprecate mean, hmean, gmean, MeanAccumulator, GMeanAccumulator, median, and center while preserving their implementations and defaults. Direct callers to mir.stat.descriptive for means and median, and mir.stat for center. Document the dependency and replacement imports, numerical differences, and distinct accumulator types. Leave simpleLinearRegression and the module itself undeprecated. AI-Assisted-By: Codex (GPT-6 Astra Medium)
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.
Direct users of the central-tendency APIs in
mir.math.statto mir-stat while preserving the legacy implementations and defaults. Prepare for these deprecations by removing statistics dependencies from product type deduction and documentation examples.Changes
statTypeand its existing tests intomir.math.internal.stat_type, register the module in Meson, and update product type deduction to import it directly. Preserve the old package-visible import throughmir.math.stat.Summatordirectly and the ndslice examples to calculate averages through summation and element counts.mean,hmean,gmean,median, andcenter, along withMeanAccumulatorandGMeanAccumulator.The changes are organized into three commits covering helper extraction, example cleanup, and deprecation.
Migration and compatibility
Use the corresponding exports from
mir.stat.descriptivefor means, their accumulators, and median. Usemir.statfor center.Existing implementations and defaults remain unchanged, but callers treating deprecations as errors (
-de) will need to migrate. Mir-stat includes numerical fixes, so extreme-input results can differ. Accumulator types from the two packages are distinct; interacting declarations should be migrated together.simpleLinearRegressionand the module itself remain undeprecated. This PR adds no dependency on mir-stat and is independent of the variance deprecations in #496.Validation
mir_testandmir_ndslice_testenabled.statTypeimport resolves to the extracted helper and that product calculations compile and run with-de.simpleLinearRegressionand its tests are unchanged.The full repository suite and Meson builds were not run locally.
AI-Assisted-By: Codex (GPT-6 Astra Medium)