Skip to content
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

Closes-4028 multi-dim testing for pdarraycreation #4093

Closed
wants to merge 1 commit into from

Conversation

drculhane
Copy link
Contributor

@drculhane drculhane commented Feb 12, 2025

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.

@drculhane drculhane closed this Feb 12, 2025
@drculhane drculhane deleted the Closes-4028 branch February 12, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant