Skip to content

Add test: if subset empty, dont crash#1557

Merged
rajeeja merged 2 commits into
mainfrom
fix-subset-empty-crash
Jul 10, 2026
Merged

Add test: if subset empty, dont crash#1557
rajeeja merged 2 commits into
mainfrom
fix-subset-empty-crash

Conversation

@Sevans711

Copy link
Copy Markdown
Collaborator

Closes #1285

Overview

If subset is empty, uxarray should return empty array, not crash. This seems to already be the case. But, it also seems to be the primary issue of #1285. This PR adds a test to ensure that is the case.

PR Checklist

General

  • An issue is linked created and linked
  • Add appropriate labels
  • Filled out Overview and Expected Usage (if applicable) sections

Testing

  • [N/A] Adequate tests are created if there is new functionality
  • [N/A] Tests cover all possible logical paths in your function
  • Tests are not too basic (such as simply calling a function and nothing else)

This ensures #1285 has been fixed. It looks like it was already fixed; the bug report seems to indicate the subsetting was previously crashing, rather than returning an empty UXarray. The current behavior seems to return an empty UXarray as expected.
@Sevans711 Sevans711 added the testing Test Cases label Jul 9, 2026
@Sevans711 Sevans711 requested a review from rajeeja July 9, 2026 18:21

@rajeeja rajeeja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally — test_empty_subset passes and full test_subset.py is green (11/11). Good fix, confirms the empty-subset contract holds.

@rajeeja rajeeja merged commit ca10462 into main Jul 10, 2026
13 checks passed
@rajeeja rajeeja deleted the fix-subset-empty-crash branch July 10, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Test Cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bounding box subsetting error

2 participants