Support Ellipsis in NDCube.__getitem__#818
Conversation
|
This will need some unit tests and a changelog entry. |
|
there is no file named test_ndslicing.py . Should I make one and add test cases there or use test_ndcube.py where some slicing tests are present. |
|
I see no harm in creating a new dedicated slicing test file. |
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
|
Should I add init.py to tests folder as error raised in pre-commit.ci |
|
Is there not an init file in that folder? If not, one needs to be added. |
| @pytest.fixture | ||
| def sample_ndcube(): | ||
| data = np.random.rand(4, 4, 4) | ||
| wcs = WCS(naxis=3) | ||
| return NDCube(data, wcs) |
There was a problem hiding this comment.
I thought there were other fixtures defined elsewhere which can be used for the test below.
I created tests folder in mixins. All tests folder have init.py file which is empty. I think I should add one. |
|
Sounds good |
|
any suggestions on the changes? |
|
I think there should be a few more tests on more complex ndcubes. But I will ping the maintainers for a review |
There was a problem hiding this comment.
Hi @Diya910. Thanks for this really helpful PR. I agree with @nabobalis that there should be a few more tests, though. I've left a code suggestion outlining some additional parameterized tests.
Also, there are slicing tests in test_ndcube.py. So the tests for this PR should probably go there too.
Finally, this branch needs to be updated with main.
Thanks again for the PR!
PR Description
This PR adds support for the ellipsis (...) syntax in NDCube allowing users to slice NDCube objects using ellipsis notation.
Issue Reference:#741