Skip to content

fix: fix data with size zero#258

Merged
tlambert03 merged 1 commit intopyapp-kit:mainfrom
tlambert03:fix-empty-bug
Mar 9, 2026
Merged

fix: fix data with size zero#258
tlambert03 merged 1 commit intopyapp-kit:mainfrom
tlambert03:fix-empty-bug

Conversation

@tlambert03
Copy link
Member

@tlambert03 tlambert03 commented Mar 9, 2026

it's technically possible (and theoretically sound) to create an array with something like shape=(0, 512, 512). In that case, ndv simply shouldn't attempt to render. this fixes that

before you got:

UserWarning: Error fetching data: cannot reshape array of size 0 into shape (512,512)
  future.set_result(func(*args, **kwargs))

@tlambert03 tlambert03 merged commit 7b56e80 into pyapp-kit:main Mar 9, 2026
123 of 125 checks passed
@tlambert03 tlambert03 deleted the fix-empty-bug branch March 9, 2026 21:27
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.65%. Comparing base (f5a94ee) to head (f1333e2).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/ndv/controllers/_array_viewer.py 0.00% 1 Missing ⚠️
src/ndv/models/_resolve.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #258      +/-   ##
==========================================
- Coverage   86.66%   86.65%   -0.02%     
==========================================
  Files          48       48              
  Lines        5684     5686       +2     
==========================================
+ Hits         4926     4927       +1     
- Misses        758      759       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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