stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

feat: add accessor protocol and refactor `stats/base/nanmskmax`

Open rahulptl165 opened this issue 11 months ago • 3 comments


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 ---

Resolves #5662 .

Description

What is the purpose of this pull request?

This pull request:

  • Adds new files accessors.js.
  • Modified existing nanmskmax.js.
  • Modified existing ndarray.js.
  • Modified readme.md, benchmark, docs/types, docs/repl.txt, examples, tests files.

Important

function nanmskmax( N, x, strideX, mask, strideMask ) {
	return ndarray( N, x, strideX, stride2offset( N, strideX ), mask, strideMask, stride2offset( N, strideMask ) );
}

Instead of above code in nanmskmax.js and tests files, I have used below code due to eslint warnings about maximum character allowed in a single line.

function nanmskmax( N, x, strideX, mask, strideMask ) {
	var offsetMask = stride2offset( N, strideMask );
	var offsetX = stride2offset( N, strideX );
	return ndarray( N, x, strideX, offsetX, mask, strideMask, offsetMask );
}

If we should not bother about warnings, request changes in review, i will modify it.

Related Issues

This pull request:

  • resolves #5662

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

rahulptl165 avatar Mar 18 '25 20:03 rahulptl165

Coverage Report

Package Statements Branches Functions Lines
stats/base/nanmskmax $\color{green}328/328$
$\color{green}+100.00\%$
$\color{green}42/42$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}328/328$
$\color{green}+100.00\%$

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

stdlib-bot avatar Mar 18 '25 20:03 stdlib-bot

kindly also adhere to the file structure that we're trying to follow, your lib directory should only contain a main.js, ndarray.js, accessors.js and index.js, see #6248 for reference

aayush0325 avatar Apr 03 '25 14:04 aayush0325

Hi @aayush0325, I have addressed requested changes. pls review it.

rahulptl165 avatar Apr 06 '25 20:04 rahulptl165

/stdlib merge

gururaj1512 avatar Jun 19 '25 12:06 gururaj1512