-
-
Notifications
You must be signed in to change notification settings - Fork 447
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
[RFC]: add tests for @stdlib/ndarray/base/nullary
#2229
Comments
👋 Hi there! 👋 And thank you for opening your first issue! We will get back to you shortly. 🏃 💨 |
@kgryte @Planeshifter @Pranavchiku I'd like to work on this issue. |
@headlessNode Thanks for opening this issue. Tests would be good to add for I would suggest, however, consulting Of note, several of the verifications you mention are not necessary, such as verifying that an ndarray-like object is provided, that a function is provided, that the ndarray-like object has specified properties, etc. Instead, tests should verify iteration behavior for 0-11D ndarrays, including contiguous and non-contiguous views, etc. Additionally, tests should verify iteration behavior for ndarrays backed by accessor arrays (e.g., ndarrays have a complex-valued data type, such as Doing all this will be required in order to achieve 100% test coverage for this package, given its implementation: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/nullary/lib |
@kgryte I have gone through the However, I noticed that I'm not assigned to this issue. I'd like to be assigned the issue to work on it. |
@headlessNode Assigned. |
Cross-linking #2350 (review) and copying over comment:
Full test coverage can be achieved by extending the strategy for 2D blocked iteration to higher dimensions, utilizing (and shuffling around) singleton dimensions to exercise isolated conditionals at each nested loop level. |
@kgryte can I go ahead and work on adding the tests for higher dimensions? |
@headlessNode Sure! See the "large arrays" tests for 2D for the idea. |
@kgryte Great. One more thing, why work on these in a new PR? I mean I could've added these in the PR we were working on. |
@headlessNode No reason other than wanting to get something in. Some tests are better than no tests. And easier to review if the changes are isolated. |
@kgryte Makes sense. Thanks for the clarification. |
PR-URL: stdlib-js#2634 Ref: stdlib-js#2229 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
PR-URL: stdlib-js#2644 Ref: stdlib-js#2229 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
PR-URL: stdlib-js#2645 Ref: stdlib-js#2229 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
PR-URL: stdlib-js#2652 Ref: stdlib-js#2229 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
PR-URL: stdlib-js#2655 Ref: stdlib-js#2229 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
PR-URL: stdlib-js#2663 Closes: stdlib-js#2229 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
Description
Currently, the
@stdlib/ndarray/base/nullary/test/test.js
only tests whether the main export is a function.This RFC proposes to add tests to verify:
The first argument provided is an ndarray-like object
The input ndarray-like object contains valid
data
,dtype
,shape
,stride
,offset
, andorder
propertiesNo modification occurs if the
data
property of the input ndarray-like object is emptyThe second argument provided is a function
The second argument returns a value compatible with the
dtype
of the output ndarrayThe
nullary
function returns voidRelated Issues
No.
Questions
No.
Other
No.
Checklist
RFC:
.The text was updated successfully, but these errors were encountered: