Skip to content

Commit

Permalink
implement scope control over check submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Aug 14, 2024
1 parent d6a13ca commit bc0b289
Show file tree
Hide file tree
Showing 25 changed files with 309 additions and 12 deletions.
165 changes: 153 additions & 12 deletions src/nwbinspector/checks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,153 @@
from .ecephys import *
from .general import *
from .image_series import *
from .images import *
from .nwb_containers import *
from .nwbfile_metadata import *
from .ogen import *
from .ophys import *
from .tables import *
from .time_series import *
from .icephys import *
from .behavior import *
from ._ecephys import (
check_negative_spike_times,
check_electrical_series_dims,
check_electrical_series_reference_electrodes_table,
check_spike_times_not_in_unobserved_interval,
)
from ._general import (
check_description,
check_name_slashes,
)
from ._image_series import (
check_image_series_data_size,
check_image_series_reference_images,
check_image_series_reference_optical_channel,
check_image_series_external_file_relative,
check_image_series_external_file_valid,
)
from ._images import (
check_order_of_images_unique,
check_order_of_images_len,
check_index_series_points_to_image,
)
from ._nwb_containers import (
check_empty_string_for_optional_attribute,
check_small_dataset_compression,
check_large_dataset_compression,
)
from ._nwbfile_metadata import (
check_keywords,
check_institution,
check_subject_age,
check_subject_sex,
check_subject_exists,
check_doi_publications,
check_experimenter_form,
check_experimenter_exists,
check_experiment_description,
check_subject_id_exists,
check_subject_species_exists,
check_subject_species_form,
check_subject_proper_age_range,
check_session_start_time_future_date,
check_processing_module_name,
check_session_start_time_old_date,
)
from ._ogen import (
check_optogenetic_stimulus_site_has_optogenetic_series,
)
from ._ophys import (
check_excitation_lambda_in_nm,
check_plane_segmentation_image_mask_shape_against_ref_images,
check_roi_response_series_dims,
check_emission_lambda_in_nm,
check_roi_response_series_link_to_plane_segmentation,
)
from ._tables import (
check_single_row,
check_ids_unique,
check_empty_table,
check_col_not_nan,
check_column_binary_capability,
check_dynamic_table_region_data_validity,
check_time_interval_time_columns,
check_time_intervals_stop_after_start,
check_table_values_for_dict,
check_table_time_columns_are_not_negative,
)
from ._time_series import (
check_resolution,
check_missing_unit,
check_regular_timestamps,
check_timestamps_ascending,
check_data_orientation,
check_timestamps_without_nans,
check_timestamps_match_first_dimension,
check_timestamp_of_the_first_sample_is_not_negative,
check_rate_is_not_zero,
)
from ._icephys import (
check_intracellular_electrode_cell_id_exists,
)
from ._behavior import (
check_compass_direction_unit,
check_spatial_series_radians_magnitude,
check_spatial_series_dims,
check_spatial_series_degrees_magnitude,
)

__all__ = [
"check_negative_spike_times",
"check_electrical_series_dims",
"check_electrical_series_reference_electrodes_table",
"check_spike_times_not_in_unobserved_interval",
"check_description",
"check_name_slashes",
"check_image_series_data_size",
"check_image_series_reference_images",
"check_image_series_reference_optical_channel",
"check_image_series_external_file_relative",
"check_image_series_external_file_valid",
"check_order_of_images_unique",
"check_order_of_images_len",
"check_index_series_points_to_image",
"check_empty_string_for_optional_attribute",
"check_small_dataset_compression",
"check_large_dataset_compression",
"check_keywords",
"check_institution",
"check_subject_age",
"check_subject_sex",
"check_subject_exists",
"check_doi_publications",
"check_experimenter_form",
"check_experimenter_exists",
"check_experiment_description",
"check_subject_id_exists",
"check_subject_species_exists",
"check_subject_species_form",
"check_subject_proper_age_range",
"check_session_start_time_future_date",
"check_processing_module_name",
"check_session_start_time_old_date",
"check_optogenetic_stimulus_site_has_optogenetic_series",
"check_excitation_lambda_in_nm",
"check_plane_segmentation_image_mask_shape_against_ref_images",
"check_roi_response_series_dims",
"check_emission_lambda_in_nm",
"check_roi_response_series_link_to_plane_segmentation",
"check_single_row",
"check_ids_unique",
"check_empty_table",
"check_col_not_nan",
"check_column_binary_capability",
"check_dynamic_table_region_data_validity",
"check_time_interval_time_columns",
"check_time_intervals_stop_after_start",
"check_table_values_for_dict",
"check_table_time_columns_are_not_negative",
"check_resolution",
"check_missing_unit",
"check_regular_timestamps",
"check_timestamps_ascending",
"check_data_orientation",
"check_timestamps_without_nans",
"check_timestamps_match_first_dimension",
"check_timestamp_of_the_first_sample_is_not_negative",
"check_rate_is_not_zero",
"check_intracellular_electrode_cell_id_exists",
"check_compass_direction_unit",
"check_spatial_series_radians_magnitude",
"check_spatial_series_dims",
"check_spatial_series_degrees_magnitude",
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/behavior/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/ecephys/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/general/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/icephys/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/image_series/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/images/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/nwb_containers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/nwbfile_metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/ogen/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/ophys/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/tables/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/time_series/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

message = (
"All submodules below the level 'nwbinspector.checks' have been deprecated. "
"Please retrieve the specific check function(s) you wish to use from the `available_checks` registry "
"at the top-level or import directly from 'nwbinspector.checks'."
)

warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
from .._behavior import *

0 comments on commit bc0b289

Please sign in to comment.