Skip to content

refactor: reuse variance implementation for stdev in stats/base/dists#11370

Merged
kgryte merged 2 commits intostdlib-js:developfrom
Om-A-osc:refactor/stats-base-dists-stdev
Apr 12, 2026
Merged

refactor: reuse variance implementation for stdev in stats/base/dists#11370
kgryte merged 2 commits intostdlib-js:developfrom
Om-A-osc:refactor/stats-base-dists-stdev

Conversation

@Om-A-osc
Copy link
Copy Markdown
Contributor


type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:

  • task: lint_filenames status: passed
  • task: lint_editorconfig status: passed
  • task: lint_markdown status: na
  • task: lint_package_json status: na
  • task: lint_repl_help status: na
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: na
  • task: lint_javascript_tests status: na
  • task: lint_javascript_benchmarks status: na
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: passed
  • task: lint_c_examples status: na
  • task: lint_c_benchmarks status: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: na
  • task: lint_license_headers status: passed

Resolves NA.

Description

What is the purpose of this pull request?

Refactored the stdev implementations to delegate to variance for non-optimized cases.

Updated lib/main.js, src/main.c, and manifest.json for the following distributions:

bradford, chisquare, hypergeometric, kumaraswamy, lognormal, pareto-type1, poisson, t, and triangular.

Left precision-oriented implementations unchanged.

Related Issues

Does this pull request have any related issues?

This pull request has no related issues.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

https://stdlib.zulipchat.com/#narrow/channel/546735-dev-questions/topic/variance.20-.20stdev.20redundancy/with/584922631

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution.

N/A


@stdlib-js/reviewers

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: passed
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@Om-A-osc Om-A-osc marked this pull request as draft April 11, 2026 09:50
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Apr 11, 2026
@Om-A-osc Om-A-osc marked this pull request as ready for review April 11, 2026 09:53
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 11, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Apr 11, 2026

Coverage Report

No coverage information available.

@Om-A-osc
Copy link
Copy Markdown
Contributor Author

failing lint_changed_files is unrelated to changed files. ( likely API related issue )

@kgryte kgryte changed the title refactor(stats/base/dists): reuse variance implementation for stdev refactor: reuse variance implementation for stdev in stats/base/dists Apr 12, 2026
@kgryte kgryte added difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. review: 5 and removed Needs Review A pull request which needs code review. labels Apr 12, 2026
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Copy link
Copy Markdown
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after clean-up.

@kgryte kgryte merged commit 9430db6 into stdlib-js:develop Apr 12, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. review: 3 Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants