chore: remove workaround for bug in tiiffile squeeze for modern versions - #1463
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR narrows the tifffile Flow diagram for tifffile squeeze compatibility selectionflowchart TD
A[tifffile version] --> B{Version >= 2026.5.2?}
B -- No --> C[asarray with squeeze=None]
B -- Yes --> D{Version < 2026.9.9?}
D -- Yes --> E[asarray with squeeze=True]
D -- No --> C
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe pull request updates TIFF squeeze handling for a bounded tifffile version range and adds ChangesTIFF version gating
Pixi lockfile ignore rule
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The TIFF compatibility change aligns with tifffile 2026.9.9 behavior, and the ignore-rule update introduces no actionable risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 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.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="package/PartSegImage/image_reader.py" line_range="468-469" />
<code_context>
image_file.report_func = report_func
try:
- image_data = image_file.asarray(squeeze=TIFFFILE_GE_2026_5_2 or None)
+ image_data = image_file.asarray(squeeze=TIFFFILE_GE_2026_5_2_AND_LT_2026_9_9 or None)
# Since tifffile version 2026.5.2, the `image_file.series` is returned in squeezed format
# So we need squeezed array in such situation
</code_context>
<issue_to_address>
**nitpick:** The comment immediately below the changed call says that every tifffile version since 2026.5.2 requires a squeezed array, but the new condition deliberately passes `None` for versions 2026.9.9 and newer. This leaves an in-code explanation that contradicts the implemented version boundary and can cause the workaround to be incorrectly reintroduced or extended later.
**Suggested fix:** Update the comment to document the limited 2026.5.2 through 2026.9.8 compatibility range and explain that the workaround is no longer used from 2026.9.9 onward.
```suggestion
# For tifffile versions 2026.5.2 through 2026.9.8, the `image_file.series` is returned in squeezed format
# and we need a squeezed array; from version 2026.9.9 onward, this workaround is no longer used
```
</issue_to_address>Sourcery assessment
Approved.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1463 +/- ##
===========================================
- Coverage 92.61% 92.59% -0.02%
===========================================
Files 211 211
Lines 33248 33248
===========================================
- Hits 30792 30787 -5
- Misses 2456 2461 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



Summary by Sourcery
Limit the tifffile squeeze workaround to versions that require it.
Bug Fixes:
Chores:
Summary by CodeRabbit
Bug Fixes
Chores