From fe5bfb4a7922a9f7f3ae11fd822dd5d618e2b0ab Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Tue, 14 Jan 2025 12:37:20 -0600 Subject: [PATCH] Remove source validation from converters and interfaces (#1168) --- CHANGELOG.md | 1 + docs/conversion_examples_gallery/behavior/lightningpose.rst | 1 - docs/conversion_examples_gallery/recording/spikeglx.rst | 1 - src/neuroconv/basedatainterface.py | 2 -- src/neuroconv/nwbconverter.py | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f20217c6c..1e7dfc4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## Bug Fixes ## Features +* Source validation is no longer performed when initializing interfaces or converters [PR #1168](https://github.com/catalystneuro/neuroconv/pull/1168) ## Improvements diff --git a/docs/conversion_examples_gallery/behavior/lightningpose.rst b/docs/conversion_examples_gallery/behavior/lightningpose.rst index a024a6799..f0b91e804 100644 --- a/docs/conversion_examples_gallery/behavior/lightningpose.rst +++ b/docs/conversion_examples_gallery/behavior/lightningpose.rst @@ -23,7 +23,6 @@ Convert LightningPose pose estimation data to NWB using :py:class:`~neuroconv.da >>> labeled_video_file_path = str(folder_path / "labeled_videos/test_vid_labeled.mp4") >>> converter = LightningPoseConverter(file_path=file_path, original_video_file_path=original_video_file_path, labeled_video_file_path=labeled_video_file_path, verbose=False) - Source data is valid! >>> metadata = converter.get_metadata() >>> # For data provenance we add the time zone information to the conversion >>> session_start_time = metadata["NWBFile"]["session_start_time"] diff --git a/docs/conversion_examples_gallery/recording/spikeglx.rst b/docs/conversion_examples_gallery/recording/spikeglx.rst index 0bc67fc1d..e6ff6bf03 100644 --- a/docs/conversion_examples_gallery/recording/spikeglx.rst +++ b/docs/conversion_examples_gallery/recording/spikeglx.rst @@ -24,7 +24,6 @@ We can easily convert all data stored in the native SpikeGLX folder structure to >>> >>> folder_path = f"{ECEPHY_DATA_PATH}/spikeglx/Noise4Sam_g0" >>> converter = SpikeGLXConverterPipe(folder_path=folder_path) - Source data is valid! >>> # Extract what metadata we can from the source files >>> metadata = converter.get_metadata() >>> # For data provenance we add the time zone information to the conversion diff --git a/src/neuroconv/basedatainterface.py b/src/neuroconv/basedatainterface.py index d9e9dc11e..64af908e3 100644 --- a/src/neuroconv/basedatainterface.py +++ b/src/neuroconv/basedatainterface.py @@ -68,8 +68,6 @@ def __init__(self, verbose: bool = False, **source_data): self.verbose = verbose self.source_data = source_data - self._validate_source_data(source_data=source_data, verbose=verbose) - def get_metadata_schema(self) -> dict: """Retrieve JSON schema for metadata.""" metadata_schema = load_dict_from_file(Path(__file__).parent / "schemas" / "base_metadata_schema.json") diff --git a/src/neuroconv/nwbconverter.py b/src/neuroconv/nwbconverter.py index ff066ad6b..5b024f126 100644 --- a/src/neuroconv/nwbconverter.py +++ b/src/neuroconv/nwbconverter.py @@ -80,7 +80,6 @@ def _validate_source_data(self, source_data: dict[str, dict], verbose: bool = Tr def __init__(self, source_data: dict[str, dict], verbose: bool = True): """Validate source_data against source_schema and initialize all data interfaces.""" self.verbose = verbose - self._validate_source_data(source_data=source_data, verbose=self.verbose) self.data_interface_objects = { name: data_interface(**source_data[name]) for name, data_interface in self.data_interface_classes.items()