stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

test: add tests to `@stdlib/ndarray/base/nullary`

Open headlessNode opened this issue 1 year ago • 2 comments

Resolves #2229

Description

What is the purpose of this pull request?

This pull request:

  • adds tests for @stdlib/ndarray/base/nullary

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves #2229

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.

I added some edge cases for blockednullary2d up to blockednullary4d (same for related complex data types) to get 100% coverage. But I don't know if I used the most feasible methods. I'd like some insight into that, thanks.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

headlessNode avatar Jun 10 '24 12:06 headlessNode

@Planeshifter @kgryte Please review, thanks.

headlessNode avatar Jun 15 '24 07:06 headlessNode

@kgryte @Planeshifter Ping, reminder.

headlessNode avatar Jun 26 '24 22:06 headlessNode

@kgryte Sure. Thanks for the guidance.

headlessNode avatar Jul 08 '24 15:07 headlessNode

@kgryte Hi, as I'm working through the refactoring, the expected array of dimension 7D+ is getting really large, 100s of elements. Here's the example shape, and stride for 7D

sh = [ 2, 2, 2, 2, 2, 2, 2 ];
st = [ 128, 64, 32, 16, 8, 2, 1 ];

Is this Okay or should I try to reduce it somehow?

headlessNode avatar Jul 10 '24 06:07 headlessNode

You can use leading singleton dimensions. E.g., shape = [ 1, 1, 1, 1, 2, 2, 2 ] . To get full code coverage, you may need to use permutations (e.g., shape = [ 2, 1, 2, 1, 1, 1, 2 ], etc).

kgryte avatar Jul 10 '24 07:07 kgryte

Alright, thanks.

headlessNode avatar Jul 10 '24 07:07 headlessNode

@kgryte Please review, thanks.

headlessNode avatar Jul 11 '24 08:07 headlessNode