Conversation

prajjwalbajpai

Resolves #5658 .

Description

What is the purpose of this pull request?

This pull request:

  • Adds support for accessor arrays and refactor stats/base/nanmeanwd

Related Issues

Does this pull request have any related issues?

This pull request:

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.


@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: na
  - 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
---
@stdlib-botstdlib-bot added StatisticsIssue or pull request related to statistical functionality.First-time ContributorA pull request from a contributor who has never previously committed to the project repository.Needs ReviewA pull request which needs code review.Good First PRA pull request resolving a Good First Issue.labels Mar 21, 2025
@stdlib-bot

Coverage Report

PackageStatementsBranchesFunctionsLines
stats/base/nanmeanwd$\color{green}311/311$
$\color{green}+100.00\%$
$\color{green}24/24$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}311/311$
$\color{green}+100.00\%$

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

@prajjwalbajpai

@aayush0325 please review

Choose a reason for hiding this comment

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

looking good, minor comments

Computes the arithmetic mean of a strided array, ignoring `NaN` values and
using Welford's algorithm.

The `N` and `stride` parameters determine which elements in `x` are accessed
at runtime.
The `N` and `stride` parameters determine which elements
Copy link
Member

Choose a reason for hiding this comment

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

can you please change the line wrapping as we can include more words here before hitting the 80 char limit

@@ -26,6 +27,8 @@ import nanmeanwd = require( './index' );
const x = new Float64Array( 10 );

nanmeanwd( x.length, x, 1 ); // $ExpectType number
nanmeanwd( x.length, new AccessorArray( x ), 1 ); // $ExpectType number

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@@ -85,6 +88,8 @@ import nanmeanwd = require( './index' );
const x = new Float64Array( 10 );

nanmeanwd.ndarray( x.length, x, 1, 0 ); // $ExpectType number
nanmeanwd.ndarray( x.length, new AccessorArray( x ), 1, 0 ); // $ExpectType number

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@@ -40,7 +40,7 @@ tape( 'the function has an arity of 3', function test( t ) {
t.end();
});

tape( 'the function calculates the arithmetic mean of a strided array', function test( t ) {
tape( 'the function calculates the arithmetic mean of a strided array (ignoring `NaN` values)', function test( t ) {
Copy link
Member

Choose a reason for hiding this comment

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

this change is not needed here

Copy link
Member

Choose a reason for hiding this comment

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

same comment for all other instances

---
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: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - 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: na
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@prajjwalbajpai

looking good, minor comments

Done

@stdlib-botstdlib-bot removed the First-time ContributorA pull request from a contributor who has never previously committed to the project repository.label Mar 22, 2025
@kgrytekgryte added the FeatureIssue or pull request for adding a new feature.label Mar 23, 2025
@kgrytekgryte changed the title feat: refactored and added protocol support to stats/base/nanmeanwd feat: refactor and add protocol support to stats/base/nanmeanwd Mar 23, 2025
@kgrytekgryte requested a review from gururaj1512 June 8, 2025 08:59
@kgryte

/stdlib merge

@stdlib-botstdlib-bot added the bot: In ProgressPull request is currently awaiting automation.label Jun 8, 2025
@stdlib-botstdlib-bot removed the bot: In ProgressPull request is currently awaiting automation.label Jun 8, 2025
@gururaj1512

/stdlib merge

@stdlib-botstdlib-bot added the bot: In ProgressPull request is currently awaiting automation.label Jun 17, 2025
@stdlib-botstdlib-bot removed the bot: In ProgressPull request is currently awaiting automation.label Jun 17, 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: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
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: passed
  - 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
---
---
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: 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: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
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: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - 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: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
gururaj1512
gururaj1512 previously approved these changes Jun 17, 2025
@gururaj1512gururaj1512 requested a review from kgryte June 17, 2025 07:54
---
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: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
Sign up for free to join this conversation on . Already have an account? Sign in to comment
FeatureIssue or pull request for adding a new feature.Good First PRA pull request resolving a Good First Issue.Needs ReviewA pull request which needs code review.StatisticsIssue or pull request related to statistical functionality.
None yet

Successfully merging this pull request may close these issues.

[RFC]: refactor and add protocol support to stats/base/nanmeanwd