-
Notifications
You must be signed in to change notification settings - Fork 28
fix_534 #562
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
fix_534 #562
Conversation
WalkthroughUpdated plotting utilities to use NaN-safe min/max when computing extents with fallbacks for all-NaN inputs. Added a test validating waterfall plotting with incomplete time coordinates by aggregating chunked data and ensuring a matplotlib Axes is returned. Changes
Suggested labels
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
dascore/utils/plotting.py (1)
68-76: Robust handling of NaN/NaT values in coordinates.The use of
nanmin/nanmaxwith a fallback to index-based extents correctly handles the edge case of all-NaN/all-NaT coordinate arrays, preventing crashes as intended for issue #534.Minor consideration: The fallback values (0,
len(array)-1) are integers, which may cause minor type inconsistency when the original array isdatetime64ortimedelta64. While the downstream conversion functions (_convert_datetimes,_convert_timedeltas) can handle integers, you might consider dtype-aware fallbacks (e.g.,np.datetime64(0, 'ns')for datetime arrays) for more explicit type preservation. However, given this is an edge case and the current approach works, this is purely optional.tests/test_viz/test_waterfall.py (1)
183-192: Test validates the fix for incomplete time coordinates.The test successfully creates a scenario with aggregated time coordinates (NaN/NaT values) and verifies that
waterfall()no longer crashes, addressing issue #534.Consider optionally enhancing test coverage by:
- Asserting that the plot extents fall back to index-based values (0 to N-1) when coordinates are all NaN
- Verifying that the axis labels or other plot properties are correctly set despite missing coordinate data
However, the current test adequately validates the primary requirement (no crash with incomplete coordinates).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
dascore/utils/plotting.py(1 hunks)tests/test_viz/test_waterfall.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
dascore/utils/plotting.py (1)
dascore/utils/misc.py (1)
suppress_warnings(82-94)
tests/test_viz/test_waterfall.py (5)
dascore/core/spool.py (4)
spool(663-692)chunk(94-141)chunk(501-531)viz(319-327)dascore/examples.py (1)
get_example_spool(710-756)dascore/utils/chunk.py (1)
chunk(429-471)dascore/proc/aggregate.py (1)
max(112-135)dascore/viz/waterfall.py (1)
waterfall(41-116)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
- GitHub Check: test_code (windows-latest, 3.12)
- GitHub Check: test_code_min_deps (macos-latest, 3.12)
- GitHub Check: test_code_min_deps (ubuntu-latest, 3.13)
- GitHub Check: test_code_min_deps (windows-latest, 3.13)
- GitHub Check: test_code (macos-latest, 3.12)
- GitHub Check: test_code (macos-latest, 3.11)
- GitHub Check: test_code (ubuntu-latest, 3.12)
- GitHub Check: test_code_min_deps (ubuntu-latest, 3.12)
- GitHub Check: test_code_min_deps (windows-latest, 3.12)
- GitHub Check: test_code (windows-latest, 3.13)
- GitHub Check: test_code (macos-latest, 3.10)
- GitHub Check: test_code (windows-latest, 3.10)
- GitHub Check: test_code (windows-latest, 3.11)
- GitHub Check: test_code (macos-latest, 3.13)
- GitHub Check: test_code (ubuntu-latest, 3.13)
- GitHub Check: test_code (ubuntu-latest, 3.11)
- GitHub Check: test_code (ubuntu-latest, 3.10)
- GitHub Check: Run benchmarks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #562 +/- ##
=======================================
Coverage 99.92% 99.92%
=======================================
Files 127 127
Lines 10616 10622 +6
=======================================
+ Hits 10608 10614 +6
Misses 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #562 will not alter performanceComparing Summary
|
Description
Implements a fix for #534.
Checklist
I have (if applicable):
Summary by CodeRabbit
Bug Fixes
Tests