diff --git a/README.md b/README.md index 6116b3e..347baaf 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ classDiagram links -------------------------------------- microscope : Microscope - light_source : LightSource + light_source : MicroscopyLightSource optical_channel : MicroscopyOpticalChannel } @@ -149,7 +149,7 @@ classDiagram emission_wavelength_in_nm : numeric, optional } - class LightSource{ + class MicroscopyLightSource{ <> -------------------------------------- @@ -183,7 +183,7 @@ classDiagram PlanarImagingSpace *-- ImagingSpace : extends VolumetricImagingSpace *-- ImagingSpace : extends MicroscopySeries ..> Microscope : links - MicroscopySeries ..> LightSource : links + MicroscopySeries ..> MicroscopyLightSource : links MicroscopySeries ..> MicroscopyOpticalChannel : links ``` diff --git a/spec/ndx-microscopy.extensions.yaml b/spec/ndx-microscopy.extensions.yaml index 518d146..da3d397 100644 --- a/spec/ndx-microscopy.extensions.yaml +++ b/spec/ndx-microscopy.extensions.yaml @@ -9,7 +9,7 @@ groups: doc: Model identifier of the light source device. required: false - - neurodata_type_def: LightSource + - neurodata_type_def: MicroscopyLightSource neurodata_type_inc: Device doc: Light source used to illuminate an imaging space. attributes: @@ -191,8 +191,8 @@ groups: doc: Link to a Microscope object containing metadata about the device used to acquire this imaging data. target_type: Microscope - name: light_source - doc: Link to a LightSource object containing metadata about the device used to illuminate the imaging space. - target_type: LightSource + doc: Link to a MicroscopyLightSource object containing metadata about the device used to illuminate the imaging space. + target_type: MicroscopyLightSource - name: optical_channel doc: Link to a MicroscopyOpticalChannel object containing metadata about the indicator and filters used to collect this data. diff --git a/src/pynwb/ndx_microscopy/__init__.py b/src/pynwb/ndx_microscopy/__init__.py index e7e3d86..722b281 100644 --- a/src/pynwb/ndx_microscopy/__init__.py +++ b/src/pynwb/ndx_microscopy/__init__.py @@ -21,7 +21,7 @@ load_namespaces(str(__spec_path)) Microscope = get_class("Microscope", extension_name) -LightSource = get_class("LightSource", extension_name) +MicroscopyLightSource = get_class("MicroscopyLightSource", extension_name) MicroscopyOpticalChannel = get_class("MicroscopyOpticalChannel", extension_name) ImagingSpace = get_class("ImagingSpace", extension_name) PlanarImagingSpace = get_class("PlanarImagingSpace", extension_name) @@ -34,7 +34,7 @@ __all__ = [ "Microscope", - "LightSource", + "MicroscopyLightSource", "MicroscopyOpticalChannel", "ImagingSpace", "PlanarImagingSpace", diff --git a/src/pynwb/ndx_microscopy/testing/__init__.py b/src/pynwb/ndx_microscopy/testing/__init__.py index 17e66d9..b305dac 100644 --- a/src/pynwb/ndx_microscopy/testing/__init__.py +++ b/src/pynwb/ndx_microscopy/testing/__init__.py @@ -1,6 +1,6 @@ from ._mock import ( - mock_LightSource, mock_Microscope, + mock_MicroscopyLightSource, mock_MicroscopyOpticalChannel, mock_MultiChannelMicroscopyVolume, mock_PlanarImagingSpace, @@ -12,7 +12,7 @@ __all__ = [ "mock_Microscope", - "mock_LightSource", + "mock_MicroscopyLightSource", "mock_MicroscopyOpticalChannel", "mock_PlanarImagingSpace", "mock_VolumetricImagingSpace", diff --git a/src/pynwb/ndx_microscopy/testing/_mock.py b/src/pynwb/ndx_microscopy/testing/_mock.py index 7570713..6a32364 100644 --- a/src/pynwb/ndx_microscopy/testing/_mock.py +++ b/src/pynwb/ndx_microscopy/testing/_mock.py @@ -23,10 +23,10 @@ def mock_Microscope( return microscope -def mock_LightSource( +def mock_MicroscopyLightSource( *, name: Optional[str] = None, - description: str = "This is a mock instance of a LightSource type to be used for rapid testing.", + description: str = "This is a mock instance of a MicroscopyLightSource type to be used for rapid testing.", manufacturer: str = "A fake manufacturer of the mock light source.", model: str = "A fake model of the mock light source.", filter_description: str = "A description about the fake filter used by the mock light source.", @@ -36,9 +36,9 @@ def mock_LightSource( intensity_in_W_per_m2: float = 0.005, exposure_time_in_s: float = 2.51e-13, pulse_rate_in_Hz: float = 2.0e6, -) -> ndx_microscopy.LightSource: - light_source = ndx_microscopy.LightSource( - name=name or name_generator("LightSource"), +) -> ndx_microscopy.MicroscopyLightSource: + light_source = ndx_microscopy.MicroscopyLightSource( + name=name or name_generator("MicroscopyLightSource"), description=description, manufacturer=manufacturer, model=model, @@ -118,7 +118,7 @@ def mock_VolumetricImagingSpace( def mock_PlanarMicroscopySeries( *, microscope: ndx_microscopy.Microscope, - light_source: ndx_microscopy.LightSource, + light_source: ndx_microscopy.MicroscopyLightSource, imaging_space: ndx_microscopy.PlanarImagingSpace, optical_channel: ndx_microscopy.MicroscopyOpticalChannel, name: Optional[str] = None, @@ -173,7 +173,7 @@ def mock_PlanarMicroscopySeries( def mock_VariableDepthMicroscopySeries( *, microscope: ndx_microscopy.Microscope, - light_source: ndx_microscopy.LightSource, + light_source: ndx_microscopy.MicroscopyLightSource, imaging_space: ndx_microscopy.PlanarImagingSpace, optical_channel: ndx_microscopy.MicroscopyOpticalChannel, name: Optional[str] = None, @@ -236,7 +236,7 @@ def mock_VariableDepthMicroscopySeries( def mock_VolumetricMicroscopySeries( *, microscope: ndx_microscopy.Microscope, - light_source: ndx_microscopy.LightSource, + light_source: ndx_microscopy.MicroscopyLightSource, imaging_space: ndx_microscopy.VolumetricImagingSpace, optical_channel: ndx_microscopy.MicroscopyOpticalChannel, name: Optional[str] = None, diff --git a/src/pynwb/tests/test_constructors.py b/src/pynwb/tests/test_constructors.py index bd6ab83..fd05c43 100644 --- a/src/pynwb/tests/test_constructors.py +++ b/src/pynwb/tests/test_constructors.py @@ -3,8 +3,8 @@ import pytest from ndx_microscopy.testing import ( - mock_LightSource, mock_Microscope, + mock_MicroscopyLightSource, mock_MicroscopyOpticalChannel, mock_MultiChannelMicroscopyVolume, mock_PlanarImagingSpace, @@ -20,7 +20,7 @@ def test_constructor_microscope(): def test_constructor_light_source(): - mock_LightSource() + mock_MicroscopyLightSource() def test_constructor_microscopy_optical_channel(): @@ -41,7 +41,7 @@ def test_constructor_volumetric_image_space(): def test_constructor_planar_microscopy_series(): microscope = mock_Microscope() - light_source = mock_LightSource() + light_source = mock_MicroscopyLightSource() imaging_space = mock_PlanarImagingSpace(microscope=microscope) optical_channel = mock_MicroscopyOpticalChannel() @@ -52,7 +52,7 @@ def test_constructor_planar_microscopy_series(): def test_constructor_variable_depth_microscopy_series(): microscope = mock_Microscope() - light_source = mock_LightSource() + light_source = mock_MicroscopyLightSource() imaging_space = mock_PlanarImagingSpace(microscope=microscope) optical_channel = mock_MicroscopyOpticalChannel() @@ -63,7 +63,7 @@ def test_constructor_variable_depth_microscopy_series(): def test_constructor_volumetric_microscopy_series(): microscope = mock_Microscope() - light_source = mock_LightSource() + light_source = mock_MicroscopyLightSource() imaging_space = mock_VolumetricImagingSpace(microscope=microscope) optical_channel = mock_MicroscopyOpticalChannel() diff --git a/src/pynwb/tests/test_roundtrip.py b/src/pynwb/tests/test_roundtrip.py index fbad5f1..58c320b 100644 --- a/src/pynwb/tests/test_roundtrip.py +++ b/src/pynwb/tests/test_roundtrip.py @@ -5,8 +5,8 @@ import pynwb from ndx_microscopy.testing import ( - mock_LightSource, mock_Microscope, + mock_MicroscopyLightSource, mock_MicroscopyOpticalChannel, mock_MultiChannelMicroscopyVolume, mock_PlanarImagingSpace, @@ -32,7 +32,7 @@ def test_roundtrip(self): microscope = mock_Microscope(name="Microscope") nwbfile.add_device(devices=microscope) - light_source = mock_LightSource(name="LightSource") + light_source = mock_MicroscopyLightSource(name="MicroscopyLightSource") nwbfile.add_device(devices=light_source) imaging_space = mock_PlanarImagingSpace(name="PlanarImagingSpace", microscope=microscope) @@ -57,7 +57,7 @@ def test_roundtrip(self): read_nwbfile = io.read() self.assertContainerEqual(microscope, read_nwbfile.devices["Microscope"]) - self.assertContainerEqual(light_source, read_nwbfile.devices["LightSource"]) + self.assertContainerEqual(light_source, read_nwbfile.devices["MicroscopyLightSource"]) self.assertContainerEqual(imaging_space, read_nwbfile.lab_meta_data["PlanarImagingSpace"]) self.assertContainerEqual(optical_channel, read_nwbfile.lab_meta_data["MicroscopyOpticalChannel"]) @@ -80,7 +80,7 @@ def test_roundtrip(self): microscope = mock_Microscope(name="Microscope") nwbfile.add_device(devices=microscope) - light_source = mock_LightSource(name="LightSource") + light_source = mock_MicroscopyLightSource(name="MicroscopyLightSource") nwbfile.add_device(devices=light_source) imaging_space = mock_VolumetricImagingSpace(name="VolumetricImagingSpace", microscope=microscope) @@ -105,7 +105,7 @@ def test_roundtrip(self): read_nwbfile = io.read() self.assertContainerEqual(microscope, read_nwbfile.devices["Microscope"]) - self.assertContainerEqual(light_source, read_nwbfile.devices["LightSource"]) + self.assertContainerEqual(light_source, read_nwbfile.devices["MicroscopyLightSource"]) self.assertContainerEqual(imaging_space, read_nwbfile.lab_meta_data["VolumetricImagingSpace"]) self.assertContainerEqual(optical_channel, read_nwbfile.lab_meta_data["MicroscopyOpticalChannel"]) @@ -130,7 +130,7 @@ def test_roundtrip(self): microscope = mock_Microscope(name="Microscope") nwbfile.add_device(devices=microscope) - light_source = mock_LightSource(name="LightSource") + light_source = mock_MicroscopyLightSource(name="MicroscopyLightSource") nwbfile.add_device(devices=light_source) imaging_space = mock_PlanarImagingSpace(name="PlanarImagingSpace", microscope=microscope) @@ -155,7 +155,7 @@ def test_roundtrip(self): read_nwbfile = io.read() self.assertContainerEqual(microscope, read_nwbfile.devices["Microscope"]) - self.assertContainerEqual(light_source, read_nwbfile.devices["LightSource"]) + self.assertContainerEqual(light_source, read_nwbfile.devices["MicroscopyLightSource"]) self.assertContainerEqual(imaging_space, read_nwbfile.lab_meta_data["PlanarImagingSpace"]) self.assertContainerEqual(optical_channel, read_nwbfile.lab_meta_data["MicroscopyOpticalChannel"])