-
Notifications
You must be signed in to change notification settings - Fork 28
fix #462 #564
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 #462 #564
Conversation
WalkthroughAdded an early code path in wiggle to handle 1D patches by plotting the single dimension against data with appropriate labeling and optional time-axis formatting, then returning the axis. Existing 2D logic remains unchanged. Added tests verifying 1D behavior, axis labeling, and show handling. Changes
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #564 +/- ##
=======================================
Coverage 99.92% 99.92%
=======================================
Files 127 127
Lines 10622 10634 +12
=======================================
+ Hits 10614 10626 +12
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 #564 will not alter performanceComparing Summary
|
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 (1)
tests/test_viz/test_wiggle.py (1)
58-66: Good test coverage for 1D patch handling.The test correctly verifies that
wiggleworks with 1D patches created viameanwithdim_reduce="squeeze", matching the scenario described in issue #462. The assertions confirm the return type and dimension labeling.Optionally, you could add an assertion to verify the y-axis label:
ax = patch_1d.viz.wiggle() assert isinstance(ax, plt.Axes) # The remaining dimension should be on the x-axis assert patch_1d.dims[0].lower() in ax.get_xlabel().lower() + assert "amplitude" in ax.get_ylabel().lower()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
dascore/viz/wiggle.py(1 hunks)tests/test_viz/test_wiggle.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
tests/test_viz/test_wiggle.py (5)
tests/test_viz/test_spectrogram.py (1)
test_1d_patch(75-79)dascore/examples.py (1)
random_patch(29-111)tests/conftest.py (1)
random_patch(282-284)dascore/proc/aggregate.py (1)
mean(140-163)dascore/viz/wiggle.py (1)
wiggle(54-135)
dascore/viz/wiggle.py (3)
dascore/core/coordmanager.py (2)
get_array(1072-1074)get_coord(1039-1058)dascore/proc/coords.py (2)
get_array(151-200)get_coord(96-148)dascore/utils/plotting.py (2)
_get_dim_label(14-19)_format_time_axis(84-103)
🔇 Additional comments (2)
dascore/viz/wiggle.py (1)
97-110: LGTM! Clean implementation of 1D patch support.The implementation correctly handles 1D patches by plotting the single dimension as the x-axis and data values as y-values with "amplitude" labeling. Time-axis formatting for datetime dimensions is properly applied, and the
showparameter is respected. This addresses issue #462 as specified.tests/test_viz/test_wiggle.py (1)
68-72: LGTM! Proper verification of the show parameter.The test correctly verifies that
wiggle(show=True)works with 1D patches by mockingplt.show.
Description
This PR fixes #462.
Checklist
I have (if applicable):
Summary by CodeRabbit
New Features
Tests