-
Notifications
You must be signed in to change notification settings - Fork 28
fix dasdae to read multi-dim coordinates #588
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
Conversation
WalkthroughChanges to DASDAE I/O coordinate handling: delimiter for parsing coordinate dimension strings changed from "." to ",", and multi-dimensional coordinates are now filtered from kwargs before calling coords.select. Tests added for multi-dimensional coordinate round-tripping. Changes
Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches✅ 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 #588 +/- ##
=======================================
Coverage 99.92% 99.92%
=======================================
Files 129 129
Lines 11241 11243 +2
=======================================
+ Hits 11233 11235 +2
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:
|
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)
dascore/io/dasdae/utils.py (1)
168-174: Filtering multi-dim coordinates out of read kwargs is reasonable; consider a small guard for the “all dropped” caseThis block correctly avoids passing multi-dimensional coordinates into
coords.select, which only supports single-dimension selectors, and thus fixes failures when round-tripping patches containing multi-dim non-dimensional coords.You might consider a small refinement:
- If
sub_kwargsends up empty (because all user kwargs referenced multi-dim coords), you could skip callingcoords.selectand just fall back to the unfiltered data path. That would make the control flow a bit clearer and avoid an unnecessary call that becomes a no-op.Behavior is otherwise sound and aligned with the goal of enabling multi-dim coord round-trips.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
dascore/io/dasdae/utils.py(2 hunks)tests/test_io/test_dasdae/test_dasdae.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
dascore/io/dasdae/utils.py (2)
dascore/core/patch.py (1)
coords(255-269)dascore/core/coordmanager.py (1)
select(594-636)
tests/test_io/test_dasdae/test_dasdae.py (1)
tests/conftest.py (2)
multi_dim_coords_patch(312-316)patch(375-377)
⏰ 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.10)
- GitHub Check: test_code (windows-latest, 3.13)
- GitHub Check: test_code (windows-latest, 3.11)
- GitHub Check: test_code (windows-latest, 3.12)
- GitHub Check: test_code (macos-latest, 3.12)
- GitHub Check: test_code (macos-latest, 3.13)
- GitHub Check: test_code (macos-latest, 3.10)
- GitHub Check: test_code (ubuntu-latest, 3.12)
- 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: test_code_min_deps (macos-latest, 3.13)
- GitHub Check: Run benchmarks
- GitHub Check: test_code_min_deps (windows-latest, 3.12)
- GitHub Check: test_code_min_deps (ubuntu-latest, 3.12)
- GitHub Check: test_code_min_deps (windows-latest, 3.13)
- GitHub Check: test_code_min_deps (macos-latest, 3.12)
- GitHub Check: test_code_min_deps (ubuntu-latest, 3.13)
🔇 Additional comments (2)
dascore/io/dasdae/utils.py (1)
143-143: Delimiter fix in_get_coordscorrectly reconstructs coord dimensionsUsing
value.split(",")matches the write-side behavior (",".join(dims)in_save_coords), so multi-dimensional coordinate dims are now reconstructed as separate dimension names instead of a single combined string. This is a correct and self-contained bugfix.tests/test_io/test_dasdae/test_dasdae.py (1)
268-285: New multi-dim coord round-trip test is well scoped and effectiveThis test cleanly captures the regression: a non-dimensional coordinate attached to two dims is written once and then read both from a directory spool and a single file, with
patch == patch2 == patch3ensuring full round-trip equality. It directly guards the behavior introduced in_get_coordsand_read_patchwithout over-specifying implementation details.
CodSpeed Performance ReportMerging #588 will not alter performanceComparing Summary
Footnotes
|
Description
Currently, patches with multi-dimensional coordinates cannot round-trip in the DASDAE format. This PR fixes that.
Checklist
I have (if applicable):
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.