Add composite image config and display options#222
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughCytoDataFrame now renders configurable multi-channel composite crops with optional segmentation overlays, preserves crop geometry across channels, and enforces notebook image sizing. Documentation, tests, and pre-commit hook revisions were also updated. ChangesComposite rendering
Pre-commit hook maintenance
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CytoDataFrame
participant CompositeRenderer
participant NotebookHTML
CytoDataFrame->>CompositeRenderer: Resolve channels and crop geometry
CompositeRenderer->>CompositeRenderer: Tint, resize, blend, and overlay images
CompositeRenderer->>NotebookHTML: Add composite HTML image column
NotebookHTML->>NotebookHTML: Render thumbnails with minimum width
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/cytodataframe/frame.py (1)
3504-3510: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: log the swallowed exception before returning
"".A failed composite render is silently converted to an empty cell with no diagnostic trail, and Ruff flags the blind
except Exception(BLE001). A debug log keeps the current behavior while making silent-empty composites diagnosable.♻️ Suggested change
try: return self._image_array_to_html(composite_array) - except Exception: + except Exception as exc: + logger.debug("Failed to render composite image as HTML: %s", exc) return ""🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/cytodataframe/frame.py` around lines 3504 - 3510, Update the exception handler around _image_array_to_html to log the caught exception at debug level before returning an empty string. Preserve the existing fallback behavior while replacing the blind exception handling with an explicitly bound exception so Ruff BLE001 is satisfied.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/cytodataframe/frame.py`:
- Around line 3095-3101: Normalize numeric width values to CSS pixel strings
before applying the image minimum-width logic in the rendering method containing
_resolve_image_min_width. Ensure configured integer widths such as 300 become
“300px” for both the emitted width style and _resolve_image_min_width, while
preserving existing handling for non-numeric width values.
---
Nitpick comments:
In `@src/cytodataframe/frame.py`:
- Around line 3504-3510: Update the exception handler around
_image_array_to_html to log the caught exception at debug level before returning
an empty string. Preserve the existing fallback behavior while replacing the
blind exception handling with an explicitly bound exception so Ruff BLE001 is
satisfied.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: af938fa7-6aea-417b-9f8c-a2d409fcd40f
📒 Files selected for processing (6)
.pre-commit-config.yamlREADME.mddocs/src/examples/cytodataframe_at_a_glance.ipynbdocs/src/examples/cytodataframe_at_a_glance.pysrc/cytodataframe/frame.pytests/test_frame.py
|
@d33bs Lucky number 222! |
Description
What kind of change(s) are included?
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.
Summary by CodeRabbit
New Features
Improvements
Documentation
Chores