Conversation
---
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
---
|
👋 Hi there! 👋 And thank you for opening your first pull request! We will review it shortly. 🏃 💨 Getting Started
Next Steps
Running Tests LocallyYou can use # Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"
# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR. If you have any further questions while waiting for a response, please join our Gitter channel to chat with project maintainers and other community members. We appreciate your contribution! Documentation Links |
Coverage Report
The above coverage report was generated for the changes in this PR. |
stats/incr/nanmpcorr2
Signed-off-by: piyxsh31 <agrawalpiyush415@gmail.com>
|
@kgryte please review this pr |
Planeshifter
left a comment
There was a problem hiding this comment.
Sorry for only now getting to looking at this PR. Implementation should delegate to base package.
| var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; | ||
| var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; | ||
| var isnan = require( '@stdlib/math/base/assert/is-nan' ); | ||
| var incrmpcorr2 = require( '@stdlib/stats/incr/mpcorr2' ); | ||
| var format = require( '@stdlib/string/format' ); |
There was a problem hiding this comment.
This should be a thin wrapper following the established nan-wrapper pattern (cf. nanmstdev, nanmcv). Remove the manual validation (isPositiveInteger, isNumber, format imports and the argument checks) and delegate directly to incrmpcorr2 — the base package already validates everything. Only imports needed here are isnan and incrmpcorr2.
| function accumulator( x, y ) { | ||
| if ( arguments.length === 0 || isnan( x ) || isnan( y ) ) { | ||
| return acc(); | ||
| } | ||
| return acc( x, y ); | ||
| } |
There was a problem hiding this comment.
Bug: if called with only one argument, y is undefined and isnan(undefined) returns false, so acc(x, undefined) gets called. Need to guard on arguments.length here as well.
Planeshifter
left a comment
There was a problem hiding this comment.
Sorry for only now getting to looking at this PR. Implementation should delegate to base package.
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves #5601.
Description
This pull request:
Related Issues
This pull request has the following related issues:
stats/incr/nanmpcorr2#5601Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers