Skip to content

Commit a711874

Browse files
authored
Add objects to analysis file before insert (#1112)
* add objects to analysis file before insert * update changelog
1 parent c5ee862 commit a711874

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dj.FreeTable(dj.conn(), "common_session.session_group").drop()
3939

4040
- Fix video directory bug in `DLCPoseEstimationSelection` #1103
4141
- Restore #973, allow DLC without position tracking #1100
42+
- Minor fix to `DLCCentroid` make function order #1112
4243

4344
- Spike Sorting
4445

src/spyglass/position/v1/position_dlc_centroid.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,13 @@ def _logged_make(self, key):
295295
# Add to Analysis NWB file
296296
analysis_file_name = AnalysisNwbfile().create(key["nwb_file_name"])
297297
nwb_analysis_file = AnalysisNwbfile()
298+
key["dlc_position_object_id"] = nwb_analysis_file.add_nwb_object(
299+
nwb_analysis_file.add_nwb_object(analysis_file_name, position)
300+
)
301+
key["dlc_velocity_object_id"] = nwb_analysis_file.add_nwb_object(
302+
nwb_analysis_file.add_nwb_object(analysis_file_name, velocity)
303+
)
304+
298305
nwb_analysis_file.add(
299306
nwb_file_name=key["nwb_file_name"],
300307
analysis_file_name=analysis_file_name,
@@ -304,12 +311,6 @@ def _logged_make(self, key):
304311
{
305312
**key,
306313
"analysis_file_name": analysis_file_name,
307-
"dlc_position_object_id": nwb_analysis_file.add_nwb_object(
308-
analysis_file_name, position
309-
),
310-
"dlc_velocity_object_id": nwb_analysis_file.add_nwb_object(
311-
analysis_file_name, velocity
312-
),
313314
}
314315
)
315316

0 commit comments

Comments
 (0)