Skip to content

Conversation

@kshitijgarg2811-oss
Copy link
Contributor

progresses #9567

Description

What is the purpose of this pull request?

This pull request:

  1. Should we remove these duplicate test cases?
  • Yes. The consecutive assertions (e.g., mean( 2.0, -1.0 )) appear to be copy-paste errors that add no value to the test suite.
  1. Should we also check if there are such duplicate test cases in any other packages?
  • Yes. I scanned the dists directory and found identical redundant assertions in several other packages.

Changes Implemented

This PR removes the duplicate assertion blocks in test.js and test.native.js for the following packages:

  • stats/base/dists/normal/mean
  • stats/base/dists/cosine/mean
  • stats/base/dists/gumbel/mean
  • stats/base/dists/laplace/mean
  • stats/base/dists/levy/mean
  • stats/base/dists/logistic/mean
  • stats/base/dists/lognormal/mean

I also verified that the tests in /stats/base/dists/kumaraswamy were not duplicates (testing -1.0 vs -1/0) and left them untouched.

Verification

All modified files were run locally to ensure that the tests pass successfully after the removal of duplicates.

Related Issues

Does this pull request have any related issues?

This pull request has the following 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.

No.

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. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

I consulted an AI assistant to help identify similar duplicate patterns across the dists directory using grep commands. The code deletions were verified manually.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. labels Jan 6, 2026
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/cosine/mean $\color{green}175/175$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}175/175$
$\color{green}+100.00%$
stats/base/dists/gumbel/mean $\color{green}176/176$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}176/176$
$\color{green}+100.00%$
stats/base/dists/laplace/mean $\color{green}175/175$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}175/175$
$\color{green}+100.00%$
stats/base/dists/levy/mean $\color{green}176/176$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}176/176$
$\color{green}+100.00%$
stats/base/dists/logistic/mean $\color{green}175/175$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}175/175$
$\color{green}+100.00%$
stats/base/dists/lognormal/mean $\color{green}176/176$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}176/176$
$\color{green}+100.00%$
stats/base/dists/normal/mean $\color{green}175/175$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}175/175$
$\color{green}+100.00%$

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

@Planeshifter
Copy link
Member

Addressed via a7a77a7. Thanks for your contribution!

@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jan 7, 2026
@kshitijgarg2811-oss
Copy link
Contributor Author

kshitijgarg2811-oss commented Jan 8, 2026

Addressed via a7a77a7. Thanks for your contribution!

@Planeshifter Thanks for the update! Glad to see the issue is resolved. I'll look for another issue to contribute to.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants