Closes-4028 multi-dim testing for pdarraycreation #4093
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds multi-dimensional tests fo most, but not all, of the functions in pdarraycreation_test.py. This gets a bit involved, so here are some comments.
I made a function to return the compiled ranks without (1), so that the multi-dim tests could easily iterate over just the multi-dimensional cases.
I made a TODO that I'd like eventually to fold the 1D and multi-dim tests together.
Some of the functions tested either only involve 1D arrays, or the tests have nothing to do with dimensionality, so I chose not to make multi-dimensional versions. Those are:
test_array_creation_transpose_bug_reproducer (note: existing transpose function is getting a new issue)
all arange functions (arange, like its numpy counterpart, only returns 1D arrays)
test_randint_misc and test_randint_with_seed (these tests have nothing to do with dimensionality)
test_zeros_misc (similarly, these tests have nothing to do with dimensionality)
similarly test_ones_misc and test_full_misc
all linspace, normal and uniform functions (again, these only return 1D arrays)
from_series (also only 1D)
test_bigint_from_uint_arrays (also only returns 1D arrays)
test_uint_greediness (doesn't involve dimensionality)
Conversely, these functions ONLY have multi-dim testing:
test_infer_shape_from_size (well, mostly, since it does accept scalars)
test_zeros_match_numpy (also ones, full) -- these had been written to only test the 2D case, but I extended them
test_zeros_error (also ones, full) -- these attempt to generate errors by making an array bigger than the compiled ranks
These were anomalies:
test_flatten, in pdarrayclass_test.py, was defined twice. I inferred that the second was meant as multi_dim, and renamed it.
the function "randint_randomness" exists, but is not run as a test because its name doesn't start with "test_". There is a comment to that affect in the function. I left this as is.
the function testTO_ndarray was also not being run, but I chose to rename it so that it would, and also made a multi-dim version.