-
-
Notifications
You must be signed in to change notification settings - Fork 869
feat: add blas/ext/last-index-of
#7665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
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 ---
Coverage Report
The above coverage report was generated for the changes in this PR. |
--- 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 ---
@headlessNode You'll want to make similar changes as done in #7565 in this PR. |
--- 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: 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: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
@kgryte done |
t.end(); | ||
}); | ||
|
||
tape( 'the function supports providing a from index (scalar, broadcasted)', function test( t ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the test that you want. You have already tested "broadcasting" of a scalar from index above. Here, you are testing that broadcasting works when specifying a dimension. That is fine, but also does not cover the case where fromIndex
is an ndarray which is NOT broadcasted. Here, that would be fromIndex
is a two-element vector, which would test the case where we use a different from index value for the two columns.
You can choose to keep this and the following tests, but you need to update the descriptions, and, at a minimum, you need to add tests for when the from index argument is not broadcasted and using different from indices. You should also test similarly for the search element (i.e., meaning a test where the search element is different for each searched row/column).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This same comment may be applicable for blas/ext/index-of
.
}; | ||
|
||
// Initialize the `fromIndex` to the first element along a dimension: | ||
fidx = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we've initialized the fromIndex
incorrectly here, as this doesn't follow https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf semantics. There, fromIndex
specifies the first element at which to begin searching backward. Here, fromIndex
is used similar to indexOf
and something like a means for reducing the sub-array.
This also needs to be addressed in blas/ext/base/*last-index-of
, as, looking at examples, those all don't appear to be parameterized correctly based upon conventional semantics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left an initial review.
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Progreses #2656.
Description
This pull request:
blas/ext/last-index-of
Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers