11"""Check functions specific to optical electrophysiology neurodata types."""
2- from pynwb .ophys import RoiResponseSeries , PlaneSegmentation , OpticalChannel , ImagingPlane
2+ from pynwb .ophys import (
3+ RoiResponseSeries ,
4+ PlaneSegmentation ,
5+ OpticalChannel ,
6+ ImagingPlane ,
7+ )
38
49from hdmf .utils import get_data_shape
510
@@ -19,30 +24,46 @@ def check_roi_response_series_dims(roi_response_series: RoiResponseSeries):
1924 if data_shape and len (data_shape ) == 2 and data_shape [1 ] != len (rois .data ):
2025 if data_shape [0 ] == len (rois .data ):
2126 return InspectorMessage (
22- message = "The second dimension of data does not match the length of rois, "
23- "but instead the first does. Data is oriented incorrectly and should be transposed."
27+ message = (
28+ "The second dimension of data does not match the length of rois, "
29+ "but instead the first does. Data is oriented incorrectly and should be transposed."
30+ )
2431 )
2532 return InspectorMessage (
2633 message = "The second dimension of data does not match the length of rois. Your data may be transposed."
2734 )
2835
2936
30- @register_check (importance = Importance .BEST_PRACTICE_VIOLATION , neurodata_type = RoiResponseSeries )
31- def check_roi_response_series_link_to_plane_segmentation (roi_response_series : RoiResponseSeries ):
37+ @register_check (
38+ importance = Importance .BEST_PRACTICE_VIOLATION , neurodata_type = RoiResponseSeries
39+ )
40+ def check_roi_response_series_link_to_plane_segmentation (
41+ roi_response_series : RoiResponseSeries ,
42+ ):
3243 """Check that each ROI response series links to a plane segmentation."""
3344 if not isinstance (roi_response_series .rois .table , PlaneSegmentation ):
34- return InspectorMessage (message = "rois field does not point to a PlaneSegmentation table." )
45+ return InspectorMessage (
46+ message = "rois field does not point to a PlaneSegmentation table."
47+ )
3548
3649
37- @register_check (importance = Importance .BEST_PRACTICE_VIOLATION , neurodata_type = OpticalChannel )
50+ @register_check (
51+ importance = Importance .BEST_PRACTICE_VIOLATION , neurodata_type = OpticalChannel
52+ )
3853def check_emission_lambda_in_nm (optical_channel : OpticalChannel ):
3954 """Check that emission lambda is in feasible range for unit nanometers."""
4055 if optical_channel .emission_lambda < MIN_LAMBDA :
41- return InspectorMessage (f"emission lambda of { optical_channel .emission_lambda } should be in units of nm." )
56+ return InspectorMessage (
57+ f"emission lambda of { optical_channel .emission_lambda } should be in units of nm."
58+ )
4259
4360
44- @register_check (importance = Importance .BEST_PRACTICE_VIOLATION , neurodata_type = ImagingPlane )
61+ @register_check (
62+ importance = Importance .BEST_PRACTICE_VIOLATION , neurodata_type = ImagingPlane
63+ )
4564def check_excitation_lambda_in_nm (imaging_plane : ImagingPlane ):
4665 """Check that emission lambda is in feasible range for unit nanometers."""
4766 if imaging_plane .excitation_lambda < MIN_LAMBDA :
48- return InspectorMessage (f"excitation lambda of { imaging_plane .excitation_lambda } should be in units of nm." )
67+ return InspectorMessage (
68+ f"excitation lambda of { imaging_plane .excitation_lambda } should be in units of nm."
69+ )
0 commit comments