From 2d5ecbf374a8b5ab12dc3bd9a843873c2ef83551 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Tue, 17 Dec 2024 11:46:04 -0800 Subject: [PATCH 1/3] added metadata and conversion_options to temporally_align_data_interfaces --- src/neuroconv/nwbconverter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/neuroconv/nwbconverter.py b/src/neuroconv/nwbconverter.py index 2d70cf8ee..f0adbcb66 100644 --- a/src/neuroconv/nwbconverter.py +++ b/src/neuroconv/nwbconverter.py @@ -259,7 +259,7 @@ def run_conversion( self.validate_metadata(metadata=metadata, append_mode=append_mode) self.validate_conversion_options(conversion_options=conversion_options) - self.temporally_align_data_interfaces() + self.temporally_align_data_interfaces(metadata=metadata, conversion_options=conversion_options) with make_or_load_nwbfile( nwbfile_path=nwbfile_path, @@ -277,7 +277,9 @@ def run_conversion( configure_backend(nwbfile=nwbfile_out, backend_configuration=backend_configuration) - def temporally_align_data_interfaces(self): + def temporally_align_data_interfaces( + self, metadata: Optional[dict] = None, conversion_options: Optional[dict] = None + ): """Override this method to implement custom alignment.""" pass From a9b6962f93c1ecc82cbe0a1390d5917b3cffd7eb Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Tue, 17 Dec 2024 13:23:29 -0800 Subject: [PATCH 2/3] updated tests --- .../test_temporal_alignment_methods.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_on_data/test_temporal_alignment/test_temporal_alignment_methods.py b/tests/test_on_data/test_temporal_alignment/test_temporal_alignment_methods.py index 081cd172d..724749574 100644 --- a/tests/test_on_data/test_temporal_alignment/test_temporal_alignment_methods.py +++ b/tests/test_on_data/test_temporal_alignment/test_temporal_alignment_methods.py @@ -2,7 +2,7 @@ from pathlib import Path from shutil import rmtree from tempfile import mkdtemp -from typing import Dict, Union +from typing import Dict, Optional, Union import numpy as np from hdmf.testing import TestCase @@ -186,7 +186,9 @@ class TestAlignmentConverter(NWBConverter): NIDQ=MockSpikeGLXNIDQInterface, Trials=CsvTimeIntervalsInterface, Behavior=MockBehaviorEventInterface ) - def temporally_align_data_interfaces(self): + def temporally_align_data_interfaces( + self, metadata: Optional[dict] = None, conversion_options: Optional[dict] = None + ): unaligned_trial_start_times = self.data_interface_objects["Trials"].get_original_timestamps( column="start_time" ) From 77659dea69e4586d56a4cf0d507bd3d46b9785cb Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 20 Dec 2024 12:40:32 -0800 Subject: [PATCH 3/3] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba0e4068f..a741189a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## Bug Fixes ## Features +* Added `metadata` and `conversion_options` as arguments to `NWBConverter.temporally_align_data_interfaces` [PR #1162](https://github.com/catalystneuro/neuroconv/pull/1162) ## Improvements