-
Notifications
You must be signed in to change notification settings - Fork 28
Add OptoDAS I/O format V10 #506
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
WalkthroughA new class, Changes
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
dascore/io/optodas/__init__.py(1 hunks)dascore/io/optodas/core.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
dascore/io/optodas/__init__.py (1)
dascore/io/optodas/core.py (2)
OptoDASV8(24-67)OptoDASV10(70-73)
🪛 Ruff (0.11.9)
dascore/io/optodas/__init__.py
9-9: .core.OptoDASV8 imported but unused; consider removing, adding to __all__, or using a redundant alias
(F401)
9-9: .core.OptoDASV10 imported but unused; consider removing, adding to __all__, or using a redundant alias
(F401)
⏰ 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). (15)
- GitHub Check: test_code (windows-latest, 3.11)
- GitHub Check: test_code (windows-latest, 3.10)
- GitHub Check: test_code (macos-latest, 3.10)
- GitHub Check: test_code (windows-latest, 3.12)
- GitHub Check: test_code (macos-latest, 3.11)
- GitHub Check: test_code (macos-latest, 3.12)
- GitHub Check: test_code (ubuntu-latest, 3.11)
- GitHub Check: test_code (ubuntu-latest, 3.10)
- GitHub Check: test_code (ubuntu-latest, 3.12)
- GitHub Check: test_code_min_deps (macos-latest, 3.13)
- GitHub Check: test_code_min_deps (windows-latest, 3.13)
- GitHub Check: test_code_min_deps (ubuntu-latest, 3.13)
- GitHub Check: test_code_min_deps (ubuntu-latest, 3.12)
- GitHub Check: test_code_min_deps (windows-latest, 3.12)
- GitHub Check: test_code_min_deps (macos-latest, 3.12)
🔇 Additional comments (2)
dascore/io/optodas/core.py (1)
70-73: No version-specific code changes needed for V10The OptoDASV10 subclass simply updates the
versionattribute to"10", and all file I/O (version detection, metadata extraction, data reading) is handled by generic utility functions (_get_opto_das_version_str,_get_opto_das_attrs,_read_opto_das). These functions operate on common HDF5 groups (fileVersion,header,data) without any hard-coded logic for versions 8 or 10, so V10 files will be picked up and parsed correctly as long as they follow the same structure.• No version‐specific branches or parsing were found in
dascore/io/optodas/utils.py.
• The new class withversion = "10"is sufficient for detection and reading.You can resolve this comment once you’ve confirmed V10 files use the same HDF5 layout.
dascore/io/optodas/__init__.py (1)
9-9: Registration and discovery of OptoDASV10 confirmed
- OptoDASV10 is defined in
dascore/io/optodas/core.pyand imported indascore/io/optodas/__init__.py- The
FiberIO.__init_subclass__hook automatically registers OptoDASV10 with the IO managerget_formatis inherited from OptoDASV8 and will return ("OptoDAS","10") for V10 files- Tests for OptoDAS live under
tests/test_io/test_optodas/test_optodas.py, ensuring the format is exercised
| """ | ||
| from __future__ import annotations | ||
| from .core import OptoDASV8 | ||
| from .core import OptoDASV8, OptoDASV10 |
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.
🛠️ Refactor suggestion
Add __all__ to properly export the classes and silence static analysis warnings.
The static analysis tool is flagging unused imports because the classes aren't explicitly exported. Add an __all__ definition to make the public API clear and resolve the warnings.
"""
from __future__ import annotations
from .core import OptoDASV8, OptoDASV10
+
+__all__ = ["OptoDASV8", "OptoDASV10"]📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| from .core import OptoDASV8, OptoDASV10 | |
| from __future__ import annotations | |
| from .core import OptoDASV8, OptoDASV10 | |
| __all__ = ["OptoDASV8", "OptoDASV10"] |
🧰 Tools
🪛 Ruff (0.11.9)
9-9: .core.OptoDASV8 imported but unused; consider removing, adding to __all__, or using a redundant alias
(F401)
9-9: .core.OptoDASV10 imported but unused; consider removing, adding to __all__, or using a redundant alias
(F401)
🤖 Prompt for AI Agents
In dascore/io/optodas/__init__.py at line 9, the imported classes OptoDASV8 and
OptoDASV10 are not explicitly exported, causing static analysis warnings. Add an
__all__ list defining these classes as public exports by setting __all__ =
["OptoDASV8", "OptoDASV10"] immediately after the import statement to clarify
the module's public API and silence the warnings.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #506 +/- ##
=======================================
Coverage 99.85% 99.85%
=======================================
Files 118 118
Lines 9711 9713 +2
=======================================
+ Hits 9697 9699 +2
Misses 14 14
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:
|
Description
The current I/O functionalities of OptoDAS are limited to Version 8. I update it to include support for the more recent Version 10.
Checklist
I have (if applicable):
Summary by CodeRabbit