Fix dev-deps CI failures: detect pynwb num_samples support via __docval__#1882
Conversation
|
(certain parts of the daily tests have been failing for a while; trying to resolve) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1882 +/- ##
==========================================
- Coverage 76.79% 76.78% -0.01%
==========================================
Files 87 87
Lines 12805 12809 +4
==========================================
+ Hits 9833 9836 +3
- Misses 2972 2973 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9f315e3 to
2c94d7b
Compare
…al__ pynwb dev (post-3.1.3) added num_samples as a required parameter for ImageSeries when format='external' and rate-based timing is used. inspect.signature() cannot detect this because hdmf's @DocVal decorator hides parameters; use __docval__['args'] instead. Co-Authored-By: Claude <noreply@anthropic.com>
2c94d7b to
a4ffe2f
Compare
|
This looks good to me. Alternatively, the test fixture could provide In PyNWB 4.0.0, a new error is raised when creating a new |
|
🚀 PR was released in |
Summary
Fix failing
dev-depsCI jobs (ubuntu-latest, Python 3.10 and 3.14) caused by pynwb dev (post-3.1.3) addingnum_samplesas a required parameter forImageSerieswhenformat='external'and rate-based timing is used.Root cause
The test fixture in
dandi/tests/fixtures.pycreatesImageSeriesobjects withoutnum_samples, which pynwb dev now requires. A simple version check viainspect.signature()doesn't work because hdmf's@docvaldecorator wraps__init__and hides parameters from Python's inspection machinery. Instead, the parameter list is stored inImageSeries.__init__.__docval__["args"].Changes
dandi/tests/fixtures.py: Detectnum_samplessupport by inspecting__docval__["args"]and conditionally passnum_samples=4when creatingImageSeriesfixtures. Includes a TODO to simplify once the minimum supported pynwb is bumped above 3.1.3.