Skip to content

Conversation

@DivyanshuVortex
Copy link
Contributor

@DivyanshuVortex DivyanshuVortex commented Dec 6, 2025


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: na
  • 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: passed
  • task: lint_license_headers status: passed
    Resolves None.

Description

This pull request:

feat : add stats/mannwhitneyu

Related Issues

This pull request has the following related issues:

Questions

No.

Other

No.

Checklist

AI Assistance

  • Yes
  • No

How was AI assistance used?

  • Code generation
  • Test/benchmark generation
  • Documentation
  • Research and understanding

Disclosure

AI assistance was used for research only.


@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: passed
  - task: lint_c_src
    status: na
  - 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: passed
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 6, 2025
---
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: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - 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: na
  - 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
---
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Dec 6, 2025
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/mannwhitneyu $\color{green}433/433$
$\color{green}+100.00%$
$\color{red}71/72$
$\color{green}+98.61%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}433/433$
$\color{green}+100.00%$

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

@DivyanshuVortex
Copy link
Contributor Author

Hey @stdlib-js/reviewers,

The CI failure looks unrelated to this PR. The R workflow stops before evaluating my changes due to a deprecated lintr rule:

Error: Linter extraction_operator_linter was deprecated in lintr version 3.2.0.

Could you provide guidance on how you’d like this handled in the R workflow?
Also, should I update the copyright year for this type of packages ?

@kgryte
Copy link
Member

kgryte commented Dec 7, 2025

@DivyanshuVortex Thanks for this PR. However, this is an instance where some up-front discussion could have been useful. While your implementation largely mirrors what can be found in ttest and other packages, we're planning on moving away from that implementation pattern in order to support multi-dimensional arrays (i.e., ndarrays). This isn't yet reflected in the top-level stats API stats/ztest, but if you examine stats/strided/ztest, this should give you an idea of where we are heading. In other words, to first implement stats/mannwhitneyu, we'd first need to implement lower-level strided array APIs (e.g., stats/strided/dmannwhitneyu, stats/strided/smannwhitneyu, stats/strided/mannwhitneyu and all associated helper utilities. Once all those are in place, we could then move on to the top-level API.

@kgryte kgryte added status: Blocked Issue or pull request which is currently blocked. and removed Needs Review A pull request which needs code review. labels Dec 7, 2025
@DivyanshuVortex
Copy link
Contributor Author

DivyanshuVortex commented Dec 7, 2025

@kgryte ,
Thanks for the clarification. I’d like to work on this and understand the lower-layer implementation in more depth, so I want to make sure I have the complete picture before proceeding.

From what I understand, the required components before adding the top-level stats/mannwhitneyu API are:

• @stdlib/stats/strided/dmannwhitneyu
• @stdlib/stats/strided/smannwhitneyu
• @stdlib/stats/strided/mannwhitneyu
• @stdlib/stats/base/ndarray/mannwhitneyu (dtype dispatcher)

Can you confirm whether this list is complete, or if there are additional strided/ndarray packages needed for Mann–Whitney U?

If this is a larger effort than expected, please let me know whether you recommend taking this on, or if it would be better for me to focus on a different package for now.

@kgryte
Copy link
Member

kgryte commented Dec 7, 2025

@DivyanshuVortex I suggest studying the stats/strided/*ztest and stats/strided/*ztest2 packages. One thing you'll find is https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/ztest which provides a collection of helper packages which are used across the ztest strided packages. We'd probably need to do something similar for Mann-Whitney, but tailored to the expected results object, alternatives, etc, of the Mann-Whitney test.

@kgryte
Copy link
Member

kgryte commented Dec 7, 2025

One other addendum is that, rather than mannwhitneyu, we'd probably name mann-whitney-u for readability (e.g., dmann-whitney-u, smann-whitney-u, etc, with alias dmannWhitneyU, smannWhitneyU, mannWhitneyU, etc).

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

Labels

Statistics Issue or pull request related to statistical functionality. status: Blocked Issue or pull request which is currently blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants