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 diff --git a/src/neuroconv/nwbconverter.py b/src/neuroconv/nwbconverter.py index ff066ad6b..833c54e82 100644 --- a/src/neuroconv/nwbconverter.py +++ b/src/neuroconv/nwbconverter.py @@ -256,7 +256,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, @@ -274,7 +274,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 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" )