11import warnings
22
33import numpy as np
4+ from hdmf .common import VectorData
45
56from pynwb .base import TimeSeries , ProcessingModule
67from pynwb .device import Device
@@ -142,7 +143,7 @@ def test_manifold_deprecated(self):
142143 indicator = 'indicator' ,
143144 location = 'location' ,
144145 manifold = (1 , 1 , (2 , 2 , 2 )))
145-
146+
146147 # create object with deprecated argument
147148 with self .assertRaisesWith (ValueError , msg ):
148149 ImagingPlane (** kwargs )
@@ -227,7 +228,7 @@ def test_init_description_optional(self):
227228 'indicator' ,
228229 'location' ,
229230 )
230-
231+
231232 def test_init_missing_required_args (self ):
232233 """Check that ImagingPlane raises an error if required args are missing."""
233234 oc , device = self .set_up_dependencies ()
@@ -527,7 +528,7 @@ def test_init(self):
527528 self .assertEqual (iS .name , 'test_iS' )
528529 self .assertEqual (iS .plane_segmentations [ps .name ], ps )
529530 self .assertEqual (iS [ps .name ], iS .plane_segmentations [ps .name ])
530-
531+
531532 def test_add_segementation (self ):
532533 ps = create_plane_segmentation ()
533534 iS = ImageSegmentation (name = 'test_iS' )
@@ -596,6 +597,7 @@ def test_init_no_name(self):
596597
597598 def test_init_missing_roi_col_with_ids (self ):
598599 """If no roi column is provided and ids were provided, an error should be raised"""
600+ iSS , ip = self .set_up_dependencies ()
599601 msg = "Must provide at least one of 'image_mask', 'pixel_mask', or 'voxel_mask' columns"
600602 with self .assertRaises (ValueError , msg = msg ):
601603 PlaneSegmentation (
@@ -608,6 +610,7 @@ def test_init_missing_roi_col_with_ids(self):
608610
609611 def test_init_missing_roi_col_with_columns (self ):
610612 """If no roi column is provided and other non-empty columns are provided, an error should be raised"""
613+ iSS , ip = self .set_up_dependencies ()
611614 msg = "Must provide at least one of 'image_mask', 'pixel_mask', or 'voxel_mask' columns"
612615 with self .assertRaises (ValueError , msg = msg ):
613616 PlaneSegmentation (
@@ -621,14 +624,15 @@ def test_init_missing_roi_col_with_columns(self):
621624
622625 def test_init_missing_roi_col_with_empty_columns (self ):
623626 """If no roi column is provided and other non-empty columns are provided, no error should be raised"""
627+ iSS , ip = self .set_up_dependencies ()
624628 pS = PlaneSegmentation (
625629 description = 'description' ,
626630 imaging_plane = ip ,
627631 name = 'test_name' ,
628632 reference_images = iSS ,
629633 columns = [VectorData (name = "custom_col" , description = "custom col" )],
630634 )
631- self .assertEqual (len (ps ), 0 )
635+ self .assertEqual (len (pS ), 0 )
632636
633637 def test_add_pixel_mask (self ):
634638 pix_mask = [[1 , 2 , 1.0 ], [3 , 4 , 1.0 ], [5 , 6 , 1.0 ],
0 commit comments