From 5400462f7fac226c13239b8ef9a827fdbc477b7e Mon Sep 17 00:00:00 2001 From: codycbakerphd Date: Thu, 18 Jul 2024 13:20:44 -0400 Subject: [PATCH] debugs --- src/pynwb/ndx_microscopy/testing/_mock.py | 14 ++++++-------- src/pynwb/tests/test_roundtrip.py | 10 ++++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pynwb/ndx_microscopy/testing/_mock.py b/src/pynwb/ndx_microscopy/testing/_mock.py index 6e34605..482e308 100644 --- a/src/pynwb/ndx_microscopy/testing/_mock.py +++ b/src/pynwb/ndx_microscopy/testing/_mock.py @@ -147,11 +147,9 @@ def mock_MicroscopyPlaneSegmentation( name = name or name_generator("MicroscopyPlaneSegmentation") plane_segmentation = ndx_microscopy.MicroscopyPlaneSegmentation( - name=name, - description=description, - imaging_space=imaging_space, + name=name, description=description, imaging_space=imaging_space, id=list(range(number_of_rois)) ) - plane_segmentation.add_column(name="id", description="", data=list(range(number_of_rois))) + # plane_segmentation.add_column(name="id", description="", data=list(range(number_of_rois))) image_masks = list() for _ in range(number_of_rois): @@ -367,9 +365,9 @@ def mock_MultiChannelMicroscopyVolume( def mock_VariableDepthMultiChannelMicroscopyVolume( *, microscope: ndx_microscopy.Microscope, - light_sources: List[ndx_microscopy.MicroscopyLightSource], imaging_space: ndx_microscopy.VolumetricImagingSpace, - optical_channels: List[ndx_microscopy.MicroscopyOpticalChannel], + light_sources: pynwb.base.VectorData, + optical_channels: pynwb.base.VectorData, name: Optional[str] = None, description: str = "This is a mock instance of a MultiChannelMicroscopyVolume type to be used for rapid testing.", data: Optional[np.ndarray] = None, @@ -392,9 +390,9 @@ def mock_VariableDepthMultiChannelMicroscopyVolume( name=series_name, description=description, microscope=microscope, - light_sources=light_sources[0], # TODO: figure out how to specify list imaging_space=imaging_space, - optical_channels=optical_channels[0], # TODO: figure out how to specify list + light_sources=light_sources, + optical_channels=optical_channels, data=imaging_data, depth_per_frame_in_mm=volume_depth_per_frame_in_mm, unit=unit, diff --git a/src/pynwb/tests/test_roundtrip.py b/src/pynwb/tests/test_roundtrip.py index ff17ef3..4d9f830 100644 --- a/src/pynwb/tests/test_roundtrip.py +++ b/src/pynwb/tests/test_roundtrip.py @@ -247,10 +247,10 @@ def tearDown(self): def test_roundtrip(self): nwbfile = mock_NWBFile() - microscope = mock_Microscope() + microscope = mock_Microscope(name="Microscope") nwbfile.add_device(devices=microscope) - imaging_space = mock_PlanarImagingSpace(microscope=microscope) + imaging_space = mock_PlanarImagingSpace(name="PlanarImagingSpace", microscope=microscope) nwbfile.add_lab_meta_data(lab_meta_data=imaging_space) # Would prefer .add_imaging_space() plane_segmentation_1 = mock_MicroscopyPlaneSegmentation( @@ -261,8 +261,10 @@ def test_roundtrip(self): ) microscopy_plane_segmentations = [plane_segmentation_1, plane_segmentation_2] - segmentations = mock_MicroscopySegmentations(microscopy_plane_segmentations=microscopy_plane_segmentations) - processing_module = nwbfile.create_processing_module(name="ophys") + segmentations = mock_MicroscopySegmentations( + name="MicroscopySegmentations", microscopy_plane_segmentations=microscopy_plane_segmentations + ) + processing_module = nwbfile.create_processing_module(name="ophys", description="") processing_module.add(segmentations) with pynwb.NWBHDF5IO(path=self.nwbfile_path, mode="w") as io: