Commit 5cc3952
Fix test suite for modern dependency versions
Pin pynwb<3 — pynwb 3.x redesigned IndexSeries API (removed
indexed_timeseries, requires Images container for indexed_images).
AllenSDK uses ImageSeries-based StimulusTemplate which is incompatible.
pynwb 2.8.3 supports Python 3.12 and preserves the existing API.
Source fixes (backward-compatible with older dep versions):
- nwbfile.modules → .processing (deprecated alias in pynwb 2.x,
removed in 3.x): running_acquisition.py, running_speed.py, nwb_api.py
- IndexSeries unit='None' → 'N/A' (pynwb 2.5+ fixed unit field):
templates.py
- np.linalg.norm([array, scalar]) → np.vstack + full_like (numpy 1.24+
rejects inhomogeneous lists): _gaze_mapper.py
- aiohttp.ClientSession created eagerly in __init__ → lazy @Property
(aiohttp 3.9+ warns when no event loop running): http_engine.py
- groupby().apply() on full DataFrame → select column first (pandas
2.2+ changed groupby-apply behavior): ecephys_project_cache.py
Test fixes:
- pytest.warns(None) → warnings.catch_warnings (pytest 8 removed
None sentinel): test_cache.py, test_smart_download.py
- mock.called_once_with (always truthy no-op) → assert_called_once()
(proper assertion): test_cell_types_cache_unit.py
- Add res.x to MagicMock (scipy.optimize.minimize result accessed
in numpy 1.24+ array construction): test_fitgaussian2D.py
- rng.choice(inhomogeneous list) → rng.integers + index (numpy 1.24+
rejects ragged sequences): conftest.py
- Widen curve-fit tolerances (scipy version/platform variance):
test_drifting_gratings.py, test_static_gratings.py
- Cast obtained dtypes to match expected (pynwb 2.x roundtrip returns
nullable boolean for float columns): test_write_nwb.py
- Align index dtypes before assert_frame_equal (pandas 2.x infers
different int dtypes): test_behavior_project_cache.py
- subprocess 'python' → sys.executable (resolves correct venv
interpreter): test_runner.py
Result: 2479 passed, 0 failed, 0 errors (was 28 failed, 5 errors).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 7d31bcd commit 5cc3952
18 files changed
Lines changed: 67 additions & 51 deletions
File tree
- allensdk
- brain_observatory
- behavior/data_objects
- running_speed
- stimuli
- ecephys
- ecephys_project_api
- gaze_mapping
- nwb
- test
- api/cloud_cache
- brain_observatory
- behavior/behavior_project_cache_data_model
- ecephys
- stimulus_analysis
- receptive_field_analysis
- core
- model
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | | - | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
127 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
128 | 132 | | |
129 | 133 | | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
| |||
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
172 | | - | |
| 177 | + | |
173 | 178 | | |
174 | 179 | | |
175 | | - | |
| 180 | + | |
176 | 181 | | |
177 | 182 | | |
178 | 183 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
740 | | - | |
741 | | - | |
742 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
662 | 663 | | |
663 | 664 | | |
664 | 665 | | |
665 | | - | |
| 666 | + | |
| 667 | + | |
666 | 668 | | |
667 | | - | |
668 | | - | |
669 | | - | |
| 669 | + | |
| 670 | + | |
670 | 671 | | |
671 | 672 | | |
672 | 673 | | |
| |||
745 | 746 | | |
746 | 747 | | |
747 | 748 | | |
748 | | - | |
| 749 | + | |
| 750 | + | |
749 | 751 | | |
750 | 752 | | |
751 | | - | |
752 | | - | |
| 753 | + | |
| 754 | + | |
753 | 755 | | |
754 | 756 | | |
755 | 757 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
425 | | - | |
| 426 | + | |
| 427 | + | |
426 | 428 | | |
427 | 429 | | |
428 | 430 | | |
429 | 431 | | |
430 | | - | |
431 | | - | |
| 432 | + | |
| 433 | + | |
432 | 434 | | |
433 | 435 | | |
434 | 436 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
0 commit comments