diff --git a/docs/api/checks.rst b/docs/api/checks.rst index 7094b9a50..d15cd6bfb 100644 --- a/docs/api/checks.rst +++ b/docs/api/checks.rst @@ -6,40 +6,40 @@ Check Functions NWBFile Metadata ---------------- -.. automodule:: nwbinspector.checks.nwbfile_metadata +.. automodule:: nwbinspector.checks._nwbfile_metadata NWB Containers -------------- -.. automodule:: nwbinspector.checks.nwb_containers +.. automodule:: nwbinspector.checks._nwb_containers Time Series ----------- -.. automodule:: nwbinspector.checks.time_series +.. automodule:: nwbinspector.checks._time_series Tables ------ -.. automodule:: nwbinspector.checks.tables +.. automodule:: nwbinspector.checks._tables Behavior -------- -.. automodule:: nwbinspector.checks.behavior +.. automodule:: nwbinspector.checks._behavior Intracellular Electrophysiology (icephys) ----------------------------------------- -.. automodule:: nwbinspector.checks.icephys +.. automodule:: nwbinspector.checks._icephys Extracellular Electrophysiology (ecephys) ----------------------------------------- -.. automodule:: nwbinspector.checks.ecephys +.. automodule:: nwbinspector.checks._ecephys Optical Electrophysiology (ophys) --------------------------------- -.. automodule:: nwbinspector.checks.ophys +.. automodule:: nwbinspector.checks._ophys Optogenetics (ogen) ------------------- -.. automodule:: nwbinspector.checks.ogen +.. automodule:: nwbinspector.checks._ogen ImageSeries ----------- -.. automodule:: nwbinspector.checks.image_series +.. automodule:: nwbinspector.checks._image_series diff --git a/docs/best_practices/behavior.rst b/docs/best_practices/behavior.rst index c31a45f11..df68e6968 100644 --- a/docs/best_practices/behavior.rst +++ b/docs/best_practices/behavior.rst @@ -14,7 +14,7 @@ SpatialSeries Dimensionality :ref:`nwb-schema:sec-SpatialSeries` should have 1 column (x), 2 columns (x, y), or 3 columns (x, y, z). -Check function: :py:meth:`~nwbinspector.checks.behavior.check_spatial_series_dims` +Check function: :py:meth:`~nwbinspector.checks._behavior.check_spatial_series_dims` .. _best_practice_spatial_series_units: @@ -25,7 +25,7 @@ SpatialSeries Units When a :ref:`nwb-schema:sec-SpatialSeries` is in a :ref:`nwb-schema:sec-CompassDirection`, the units should either be "degrees" or "radians". -Check function: :py:meth:`~nwbinspector.checks.behavior.check_compass_direction_unit` +Check function: :py:meth:`~nwbinspector.checks._behavior.check_compass_direction_unit` .. _best_practice_spatial_series_values: @@ -37,4 +37,4 @@ When a :ref:`nwb-schema:sec-SpatialSeries` has units "radians", it should have d :ref:`nwb-schema:sec-SpatialSeries` has units "degrees", it should have data values between -360 and 360. Check functions: :py:meth:`~nwbinspector.checks.behavior.check_spatial_series_radians_magnitude`, -:py:meth:`~nwbinspector.checks.behavior.check_spatial_series_degrees_magnitude` +:py:meth:`~nwbinspector.checks._behavior.check_spatial_series_degrees_magnitude` diff --git a/docs/best_practices/ecephys.rst b/docs/best_practices/ecephys.rst index 77be73762..10582808e 100644 --- a/docs/best_practices/ecephys.rst +++ b/docs/best_practices/ecephys.rst @@ -77,7 +77,7 @@ All spike times should be greater than zero. Being less than zero implies the sp should therefore be aligned to the ``timestamps_reference_time`` of the :ref:`nwb-schema:sec-NWBFile`) or the ``timestamps_reference_time`` itself is not set to the earliest recording time during the session. -Check function: :py:meth:`~nwbinspector.checks.ecephys.check_negative_spike_times` +Check function: :py:meth:`~nwbinspector.checks._ecephys.check_negative_spike_times` @@ -88,4 +88,4 @@ Observation Intervals The ``obs_intervals`` field of the :ref:`nwb-schema:sec-units-src` table is used to indicate periods of time where the underlying electrical signal(s) were not observed. This can happen if the recording site moves away from the unit, or if the recording is stopped. Since the channel is not observed, it is not determinable whether a spike occurred during this time. Therefore, there should not be any identified spike times for units matched to those electrical signal(s) occurring outside of the defined ``obs_intervals``. If this variable is not set, it is assumed that all time is observed. -Check function: :py:meth:`~nwbinspector.checks.ecephys.check_spike_times_not_in_unobserved_interval` +Check function: :py:meth:`~nwbinspector.checks._ecephys.check_spike_times_not_in_unobserved_interval` diff --git a/docs/best_practices/general.rst b/docs/best_practices/general.rst index 1f68f6f3c..f4ed6356b 100644 --- a/docs/best_practices/general.rst +++ b/docs/best_practices/general.rst @@ -42,7 +42,7 @@ Slash characters ``'/'`` and ``'\'`` should not be used in the ``name`` of an o For mathematical expressions, instead of including the special character in the name, please use an English equivalent instead. *E.g.*, instead of "Df/f" use "DfOverF". -Check function: :py:meth:`~nwbinspector.checks.general.check_name_slashes` +Check function: :py:meth:`~nwbinspector.checks._general.check_name_slashes` @@ -55,7 +55,7 @@ The :py:attr:`name` of an object is for identifying that object within the file; It is acceptable to name an object something like ``ElectricalSeriesFromProbe1`` as per the uniqueness requirement of :ref:`best_practice_object_names`, however the name alone is not sufficient documentation of the signal source. In this case, the source of the signal will be clear from the :ref:`nwb-schema:devices` linkage in the rows of the passed :ref:`hdmf-schema:sec-dynamictableregion` subsetting the full ``ElectrodeTable``, so you would not need to add any explicit metadata explaining these details. -Check function: :py:meth:`~nwbinspector.checks.general.check_description` +Check function: :py:meth:`~nwbinspector.checks._general.check_description` diff --git a/docs/best_practices/image_series.rst b/docs/best_practices/image_series.rst index f6c750451..75c7013d6 100644 --- a/docs/best_practices/image_series.rst +++ b/docs/best_practices/image_series.rst @@ -14,7 +14,7 @@ an external file. That is, the file should be packaged together with the nwb fil This can be accomplished by using the ``external_file`` file option to store the path instead. This is preferred for videos because it allows the usage of video compression codecs that are lossy and highly optimized for such videos. -Check function: :py:meth:`~nwbinspector.checks.image_series.check_image_series_data_size` +Check function: :py:meth:`~nwbinspector.checks._image_series.check_image_series_data_size` Use internal dataset for videos of neurophysiological data @@ -32,4 +32,4 @@ Use relative path for external mode When using ``external_file`` the paths passed in the ``external_file`` option should be relative to the location of the nwb file. -Check function: :py:meth:`~nwbinspector.checks.image_series.check_image_series_external_file_relative` +Check function: :py:meth:`~nwbinspector.checks._image_series.check_image_series_external_file_relative` diff --git a/docs/best_practices/nwbfile_metadata.rst b/docs/best_practices/nwbfile_metadata.rst index 8cdbf5679..53c5878c8 100644 --- a/docs/best_practices/nwbfile_metadata.rst +++ b/docs/best_practices/nwbfile_metadata.rst @@ -30,10 +30,10 @@ value. Default values should generally not be used for this field. If the true d best guess. If the exact start time is unknown, then it is fine to simply set it to midnight on that date. -Check functions: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_session_start_time_old_date`, -:py:meth:`~nwbinspector.checks.nwbfile_metadata.check_session_start_time_future_date`, -:py:meth:`~nwbinspector.checks.time_series.check_timestamp_of_the_first_sample_is_not_negative` -:py:meth:`~nwbinspector.checks.tables.check_table_time_columns_are_not_negative` +Check functions: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_session_start_time_old_date`, +:py:meth:`~nwbinspector.checks._nwbfile_metadata.check_session_start_time_future_date`, +:py:meth:`~nwbinspector.checks._time_series.check_timestamp_of_the_first_sample_is_not_negative` +:py:meth:`~nwbinspector.checks._tables.check_table_time_columns_are_not_negative` @@ -65,7 +65,7 @@ The name of any given processing module should be chosen from the following type modalities. It also helps distinguish components of a given experiment, such as decoupling the intermediate data from neural acquisition systems from behavioral ones. -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_processing_module_name` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_processing_module_name` @@ -103,7 +103,7 @@ Experimenter The ``experimenter`` field of an :ref:`nwb-schema:sec-NWBFile` should be specified as any of the accepted forms: 'LastName, Firstname', 'LastName, FirstName MiddleInitial.' or 'LastName, FirstName MiddleName'. -Check functions: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_experimenter_exists` and :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_experimenter_form` +Check functions: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_experimenter_exists` and :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_experimenter_form` @@ -115,7 +115,7 @@ Experiment Description The ``experiment_description`` field of an :ref:`nwb-schema:sec-NWBFile` should be specified. This helps provide context for understanding the contents of the file. -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_experiment_description` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_experiment_description` @@ -127,7 +127,7 @@ Institution The ``institution`` field should be specified. This allows metadata collection programs, such as those on the :dandi-archive:`DANDI archive <>` to easily scan NWBFiles to deliver summary statistics. -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_institution` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_institution` @@ -159,7 +159,7 @@ of the form ``'doi: ###'`` or as an external link of the form ``'http://dx.doi.o This allows metadata collection programs, such as those on the :dandi-archive:`DANDI archive <>` to easily form direct hyperlinks to the publications. -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_doi_publications` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_doi_publications` @@ -171,7 +171,7 @@ Subject It is recommended to always include as many details about the experimental subject as possible. If the data is simulated, a simple ID of "simulated_subject" would be sufficient. -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_subject_exists` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_subject_exists` @@ -186,7 +186,7 @@ not intended for DANDI upload, if the :ref:`nwb-schema:sec-Subject` is specified In the special case of *in vitro* studies where the 'subject' of scientific interest was not a tissue sample obtained from a living subject but was instead a purified protein, this will be annotated by prepending the keyphrase "protein" to the subject ID; *e.g*, "proteinCaMPARI3". In the case where the *in vitro* experiment is performed on an extracted or cultured biological sample, the other subject attributes (such as age and sex) should be specified as their values at the time the sample was collected. -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_subject_id_exists` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_subject_id_exists` @@ -200,7 +200,7 @@ following four possibilities: "M" (male), "F" (female), "U" (unknown), or "O" (o C. elegans are an exception to this rule. For C. elegans, the sex should either be "XO" (male) or "XX" (hermaphrodite). -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_subject_sex` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_subject_sex` @@ -211,7 +211,7 @@ Subject Species The ``species`` of a :ref:`nwb-schema:sec-Subject` should be set to the proper :wikipedia:`Latin binomial ` or otherwise a full link to the Term IRI for the :ncbi:`NCBI Taxonomy <>`, which can be easily found at the :ontobee:`Ontobee <>` database. *E.g.*, a rat would be "Rattus norvegicus" or "http://purl.obolibrary.org/obo/NCBITaxon_10116". -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_subject_species_form` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_subject_species_form` @@ -235,7 +235,7 @@ If the precise age is unknown, an age range can be given by "[lower bound]/[uppe that the age is in between 10 and 20 days. If only the lower bound is known, then including only the slash after that lower bound can be used to indicate a missing bound. For instance, "P90Y/" would indicate that the age is 90 years or older. -Check function: :py:meth:`~nwbinspector.checks.nwbfile_metadata.check_subject_age` +Check function: :py:meth:`~nwbinspector.checks._nwbfile_metadata.check_subject_age` diff --git a/docs/best_practices/ogen.rst b/docs/best_practices/ogen.rst index ae7895cb8..959147ebc 100644 --- a/docs/best_practices/ogen.rst +++ b/docs/best_practices/ogen.rst @@ -9,4 +9,4 @@ OptogeneticSeries Each :ref:`nwb-schema:sec-OptogeneticStimulusSite` object should be referenced by at least one :ref:`nwb-schema:sec-OptogeneticSeries` in the same file. -Check function: :py:meth:`~nwbinspector.checks.ogen.check_optogenetic_stimulus_site_has_optogenetic_series` +Check function: :py:meth:`~nwbinspector.checks._ogen.check_optogenetic_stimulus_site_has_optogenetic_series` diff --git a/docs/best_practices/tables.rst b/docs/best_practices/tables.rst index 1937879ec..678d86cf6 100644 --- a/docs/best_practices/tables.rst +++ b/docs/best_practices/tables.rst @@ -12,7 +12,7 @@ Table Values String-valued table entries should not contain :wikipedia:`JSON `. Instead, these values should be unpacked and used as additional columns of that table. -Check function: :py:meth:`~nwbinspector.checks.tables.check_table_values_for_dict` +Check function: :py:meth:`~nwbinspector.checks._tables.check_table_values_for_dict` @@ -32,7 +32,7 @@ Tables With Only a Single Row It is not common to save a table with only a single row entry. Consider other ``neurodata_types``, such as a one-dimensional :ref:`nwb-schema:sec-TimeSeries`. -Check function: :py:meth:`~nwbinspector.checks.tables.check_single_row` +Check function: :py:meth:`~nwbinspector.checks._tables.check_single_row` @@ -44,7 +44,7 @@ Tables With an Entire Column as ``NaN`` If an entire column of a :ref:`hdmf-schema:sec-dynamictable` would be filled with ``NaN`` values, then it should not be written. -Check function: :py:meth:`~nwbinspector.checks.tables.check_col_not_nan` +Check function: :py:meth:`~nwbinspector.checks._tables.check_col_not_nan` @@ -56,7 +56,7 @@ Table Region Data Store data with long columns rather than long rows. When constructing dynamic tables, keep in mind that the data is stored by column, so it will be less efficient to store data in a table that has many more columns than rows. -Check function :py:meth:`~nwbinspector.checks.tables.check_dynamic_table_region_data_validity` +Check function :py:meth:`~nwbinspector.checks._tables.check_dynamic_table_region_data_validity` diff --git a/docs/best_practices/time_series.rst b/docs/best_practices/time_series.rst index dddf39c2a..e3fc490d8 100644 --- a/docs/best_practices/time_series.rst +++ b/docs/best_practices/time_series.rst @@ -19,8 +19,8 @@ Keep in mind that the dimensions are reversed in MatNWB, so in memory in MatNWB In PyNWB the order of the dimensions is the same in memory as on disk, so the time index should be first. -Check functions: :py:meth:`~nwbinspector.checks.time_series.check_data_orientation` and -:py:meth:`~nwbinspector.checks.time_series.check_timestamps_match_first_dimension` +Check functions: :py:meth:`~nwbinspector.checks._time_series.check_data_orientation` and +:py:meth:`~nwbinspector.checks._time_series.check_timestamps_match_first_dimension` @@ -35,7 +35,7 @@ Every :ref:`nwb-schema:sec-TimeSeries` instance has ``unit`` as an attribute, wh measurement for that data, using the appropriate type from the :wikipedia:`International System of Units (SI) `. -Check function: :py:meth:`~nwbinspector.checks.time_series.check_missing_unit` +Check function: :py:meth:`~nwbinspector.checks._time_series.check_missing_unit` @@ -82,7 +82,7 @@ A primary implication is that the values in :ref:`nwb-schema:TimeSeries.timestam corresponding ordering of their indices in the :ref:`nwb-schema:TimeSeries.data ` array, should always be strictly increasing. -Check function: :py:meth:`~nwbinspector.checks.time_series.check_timestamps_ascending` +Check function: :py:meth:`~nwbinspector.checks._time_series.check_timestamps_ascending` @@ -98,7 +98,7 @@ Ensure that all timestamps are valid numerical values. If gaps in time need to b data into separate :ref:`nwb-schema:sec-TimeSeries` objects with appropriate ``starting_time`` or use the ``timestamps`` vector to explicitly represent time gaps. -Check function: :py:meth:`~nwbinspector.checks.time_series.check_timestamps_without_nans` +Check function: :py:meth:`~nwbinspector.checks._time_series.check_timestamps_without_nans` @@ -120,7 +120,7 @@ For segmented data, refer to the section covering :ref:`best_practice_timestamps 2. Even if the sampling rate is constant within each segment, a single :ref:`nwb-schema:sec-TimeSeries` can be written using the ``timestamps`` vector to appropriately indicate the gaps between segments. -Check function: :py:meth:`~nwbinspector.checks.time_series.check_regular_timestamps` +Check function: :py:meth:`~nwbinspector.checks._time_series.check_regular_timestamps` @@ -161,8 +161,8 @@ chunk individually. This is especially important when writing NWBFiles that are :pynwb-docs:`PyNWB tutorial ` or the `MatNWB instructions `_ -Check functions: :py::meth:`~nwbinspector.checks.nwb_containers.check_large_dataset_compression`, -:py::meth:`~nwbinspector.checks.nwb_containers.check_small_dataset_compression` +Check functions: :py::meth:`~nwbinspector.checks._nwb_containers.check_large_dataset_compression`, +:py::meth:`~nwbinspector.checks._nwb_containers.check_small_dataset_compression` @@ -173,7 +173,7 @@ Unknown Resolution If the ``resolution`` of a :ref:`nwb-schema:sec-TimeSeries` is unknown, use ``-1.0`` or ``NaN`` to indicate this. -Check function: :py::meth:`~nwbinspector.checks.time_series.check_resolution` +Check function: :py::meth:`~nwbinspector.checks._time_series.check_resolution` @@ -184,4 +184,4 @@ Zero Rate If the ``data`` field of :ref:`nwb-schema:sec-TimeSeries` has more than one frame, and according to :ref:`best_practice_data_orientation` this axis ought to be time, then the ``rate`` field should not be ``0.0``. -Check function: :py::meth:`~nwbinspector.checks.time_series.check_rate_is_not_zero` +Check function: :py::meth:`~nwbinspector.checks._time_series.check_rate_is_not_zero` diff --git a/docs/best_practices/todo.rst b/docs/best_practices/todo.rst deleted file mode 100644 index 7f5176ffb..000000000 --- a/docs/best_practices/todo.rst +++ /dev/null @@ -1,30 +0,0 @@ -:orphan: - -This is an isolated page of the documentation containing all current section references autogenerated by the check to best practice linkage of the conf.py - this page is temporary and is not to be included in any index - -When all of these are done, this page will be removed. - - - -.. _best_practice_intracellular_electrode_cell_id_exists: - -TODO ----- - -No `icephys` section yet. - -.. _best_practice_electrical_series_reference_electrodes_table: - -TODO ----- - -Short section about this. - - - -.. _best_practice_roi_response_series_link_to_plane_segmentation: - -TODO ----- - -Very similar to the electrode table one. diff --git a/src/nwbinspector/checks/_ecephys.py b/src/nwbinspector/checks/_ecephys.py index 8c9934d3a..5487c04cc 100644 --- a/src/nwbinspector/checks/_ecephys.py +++ b/src/nwbinspector/checks/_ecephys.py @@ -50,7 +50,11 @@ def check_electrical_series_dims(electrical_series: ElectricalSeries): @register_check(importance=Importance.BEST_PRACTICE_VIOLATION, neurodata_type=ElectricalSeries) def check_electrical_series_reference_electrodes_table(electrical_series: ElectricalSeries): - """Check that the 'electrodes' of an ElectricalSeries references the ElectrodesTable.""" + """ + Check that the 'electrodes' of an ElectricalSeries references the ElectrodesTable. + + Best Practice: TODO + """ if electrical_series.electrodes.table.name != "electrodes": return InspectorMessage(message="electrodes does not reference an electrodes table.") diff --git a/src/nwbinspector/checks/_icephys.py b/src/nwbinspector/checks/_icephys.py index c41e25529..02cf1d319 100644 --- a/src/nwbinspector/checks/_icephys.py +++ b/src/nwbinspector/checks/_icephys.py @@ -7,6 +7,10 @@ @register_check(importance=Importance.BEST_PRACTICE_VIOLATION, neurodata_type=IntracellularElectrode) def check_intracellular_electrode_cell_id_exists(intracellular_electrode: IntracellularElectrode): - """Check if the IntracellularElectrode contains a cell_id.""" + """ + Check if the IntracellularElectrode contains a cell_id. + + Best Practice: TODO + """ if hasattr(intracellular_electrode, "cell_id") and intracellular_electrode.cell_id is None: return InspectorMessage(message="Please include a unique cell_id associated with this IntracellularElectrode.") diff --git a/src/nwbinspector/checks/_ophys.py b/src/nwbinspector/checks/_ophys.py index 54b9626c2..c28b8119b 100644 --- a/src/nwbinspector/checks/_ophys.py +++ b/src/nwbinspector/checks/_ophys.py @@ -42,7 +42,11 @@ def check_roi_response_series_dims(roi_response_series: RoiResponseSeries): def check_roi_response_series_link_to_plane_segmentation( roi_response_series: RoiResponseSeries, ): - """Check that each ROI response series links to a plane segmentation.""" + """ + Check that each ROI response series links to a plane segmentation. + + Best Practice: TODO + """ if not isinstance(roi_response_series.rois.table, PlaneSegmentation): return InspectorMessage(message="rois field does not point to a PlaneSegmentation table.") diff --git a/src/nwbinspector/checks/nwbfile_metadata/__init__.py b/src/nwbinspector/checks/nwbfile_metadata/__init__.py index 2af1dc2b4..d21e9f49e 100644 --- a/src/nwbinspector/checks/nwbfile_metadata/__init__.py +++ b/src/nwbinspector/checks/nwbfile_metadata/__init__.py @@ -11,3 +11,8 @@ # Still keep imports functional with warning for soft deprecation cycle # TODO: remove after 9/15/2024 from .._nwbfile_metadata import * + +# from .._nwbfile_metadata import check_subject_age +# __all__ = [ +# "check_subject_age", +# ]