Skip to content

fix: support HDF5Data instances in detect_flickering - #81

Merged
paulmueller merged 1 commit into
DC-analysis:mainfrom
paulmueller-agent:fix-detect-flickering-hdf5data
Nov 23, 2026
Merged

paulmueller merged 1 commit into
DC-analysis:mainfrom
paulmueller-agent:fix-detect-flickering-hdf5data

Conversation

@paulmueller-agent

Copy link
Copy Markdown
Contributor

The docstring of detect_flickering allows an HDF5Data instance as image_data, but the function sliced the instance itself (image_data[:max_frames]). That fails in HDF5Data.__getitem__:

detect_flickering(HDF5Data(path))
TypeError: A name should be string or bytes, not <class 'slice'>

This has been the case since the function was introduced (0.25.0).

Fix

For an HDF5Data instance, image_data.image is used. The docstring now says that the "image" feature is used.

Tests

  • test_detect_flicker_hdf5data_instance now also passes the HDF5Data instance itself. It fails on main and passes here.
  • tests/test_read_detect_flicker.py and tests/test_read_cache.py pass.
  • flake8 is clean, and ruff shows no new errors.

🤖 Generated with Claude Code

The docstring allowed `HDF5Data` instances, but slicing them failed
with a `TypeError`. The "image" feature of the instance is used now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paulmueller
paulmueller merged commit ec38e31 into DC-analysis:main Nov 23, 2026
6 checks passed
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.19%. Comparing base (3e172b6) to head (2ef00c2).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
+ Coverage   88.14%   88.19%   +0.04%     
==========================================
  Files          63       63              
  Lines        4522     4524       +2     
==========================================
+ Hits         3986     3990       +4     
+ Misses        536      534       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants