Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #268 from catalystneuro/generalize_get_source_schema
Browse files Browse the repository at this point in the history
generalized get_source_schema() across all interfaces
  • Loading branch information
CodyCBakerPhD authored Sep 28, 2021
2 parents 6fd3446 + d1cb8b1 commit 5967fe7
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion nwb_conversion_tools/basedatainterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class BaseDataInterface(ABC):
@classmethod
def get_source_schema(cls):
return get_base_schema()
return get_schema_from_method_signature(cls.__init__, exclude=["source_data"])

@classmethod
def get_conversion_options_schema(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ def __init__(self, file_paths: list):
assert HAVE_OPENCV, INSTALL_MESSAGE
super().__init__(file_paths=file_paths)

@classmethod
def get_source_schema(cls):
return get_schema_from_method_signature(cls.__init__)

def run_conversion(
self,
nwbfile: NWBFile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ class BaseRecordingExtractorInterface(BaseDataInterface, ABC):

RX = None

@classmethod
def get_source_schema(cls):
"""Compile input schema for the RecordingExtractor."""
return get_schema_from_method_signature(cls.__init__)

def __init__(self, **source_data):
super().__init__(**source_data)
self.recording_extractor = self.RX(**source_data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ class BaseSortingExtractorInterface(BaseDataInterface, ABC):

SX = None

@classmethod
def get_source_schema(cls):
"""Compile input schema for the SortingExtractor."""
return get_schema_from_method_signature(cls.__init__)

def __init__(self, **source_data):
super().__init__(**source_data)
self.sorting_extractor = self.SX(**source_data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
class BaseImagingExtractorInterface(BaseDataInterface):
IX = None

@classmethod
def get_source_schema(cls):
return get_schema_from_method_signature(cls.__init__)

def __init__(self, **source_data):
super().__init__(**source_data)
self.imaging_extractor = self.IX(**source_data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
class BaseSegmentationExtractorInterface(BaseDataInterface, ABC):
SegX = None

@classmethod
def get_source_schema(cls):
return get_schema_from_method_signature(cls.__init__)

def __init__(self, **source_data):
super().__init__(**source_data)
self.segmentation_extractor = self.SegX(**source_data)
Expand Down

0 comments on commit 5967fe7

Please sign in to comment.