Skip to content

feat: add implementation of stats/strided/diqrsorted#10300

Open
Om-A-osc wants to merge 1 commit intostdlib-js:developfrom
Om-A-osc:feat/stats-strided-diqrsorted
Open

feat: add implementation of stats/strided/diqrsorted#10300
Om-A-osc wants to merge 1 commit intostdlib-js:developfrom
Om-A-osc:feat/stats-strided-diqrsorted

Conversation

@Om-A-osc
Copy link
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: passed
  • task: lint_package_json status: passed
  • task: lint_repl_help status: passed
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • task: lint_javascript_tests status: passed
  • task: lint_javascript_benchmarks status: passed
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: passed
  • task: lint_c_examples status: passed
  • task: lint_c_benchmarks status: passed
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: passed
  • task: lint_license_headers status: passed

Resolves #NA

Description

What is the purpose of this pull request?

This pull request:

  • adds an implementation of @stdlib/stats/strided/diqrsorted
  • computes the interquartile range (IQR) for sorted double-precision
    floating-point strided arrays
  • leverages the existing dmediansorted implementation to compute
    the first and third quartiles, ensuring numerical correctness and
    consistency with existing sorted statistics utilities
  • provides both main and .ndarray interfaces following stdlib
    strided API conventions
  • includes comprehensive unit tests covering edge cases, stride,
    negative stride, and offset semantics
  • adds benchmarks for performance evaluation
  • includes a C implementation and corresponding examples to maintain
    parity with other strided statistical routines
  • adds REPL help, documentation, and examples
  • follows stdlib formatting, linting, and code style guidelines

This addition extends the sorted statistics utilities by providing a
robust and efficient measure of statistical dispersion.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • NA

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.

Implementation notes:

  • The implementation assumes the input array is already sorted.
  • Quartiles are computed using the median-of-halves approach,
    consistent with common statistical definitions and boxplot usage.
  • Reusing dmediansorted reduces duplication and ensures
    consistency with existing sorted median behavior.

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

Disclosure

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: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: passed
  - task: lint_c_examples
    status: passed
  - task: lint_c_benchmarks
    status: passed
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. labels Feb 15, 2026
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/strided/diqrsorted $\color{green}314/314$
$\color{green}+100.00%$
$\color{green}17/17$
$\color{green}+100.00%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}314/314$
$\color{green}+100.00%$

The above coverage report was generated for the changes in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments