Skip to content

Commit cdae389

Browse files
authored
Quickfix: PositionSource no entries (LorenFrankLab#1405)
* return none when no position data * update changelog
1 parent b304aa5 commit cdae389

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import all foreign key references.
4141
- Position
4242
- Ensure video files are properly added to `DLCProject` # 1367
4343
- DLC parameter handling improvements and default value corrections #1379
44+
- Fix ingestion nwb files with position objects but no spatial series #1405
4445
- Spikesorting
4546
- Implement short-transaction `SpikeSortingRecording.make` for v0 #1338
4647

src/spyglass/utils/nwb_helper_fn.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,16 @@ def get_all_spatial_series(nwbf, verbose=False, incl_times=True) -> dict:
579579
if pos_interface is None:
580580
return None
581581

582-
return _get_pos_dict(
582+
pos_dict = _get_pos_dict(
583583
position=pos_interface.spatial_series,
584584
epoch_groups=_get_epoch_groups(pos_interface),
585585
session_id=nwbf.session_id,
586586
verbose=verbose,
587587
incl_times=incl_times,
588588
)
589+
if len(pos_dict) == 0:
590+
return None
591+
return pos_dict
589592

590593

591594
def get_nwb_copy_filename(nwb_file_name):

0 commit comments

Comments
 (0)