From 6f235426e3adc8c06404b93d74e63c13730b2e75 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:45:10 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 6 ++--- requirements-min.txt | 2 +- src/pynwb/ndx_microscopy/__init__.py | 8 ++---- src/pynwb/ndx_microscopy/testing/__init__.py | 4 +-- src/pynwb/ndx_microscopy/testing/_mock.py | 19 +++++--------- src/pynwb/tests/test_constructors.py | 27 +++++++++++++++----- src/pynwb/tests/test_roundtrip.py | 8 +++--- 7 files changed, 40 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index c1c5e80..bc78799 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ classDiagram class MultiChannelMicroscopyVolume { <> - + -------------------------------------- attributes -------------------------------------- @@ -104,14 +104,14 @@ classDiagram --> unit : text excitation_light_paths : ExcitationLightPath, excitation_light_paths emission_light_paths : EmissionLightPath, emission_light_paths - + -------------------------------------- links -------------------------------------- imaging_space : VolumetricImageSpace microscope : Microscope } - + class ImagingSpace{ <> diff --git a/requirements-min.txt b/requirements-min.txt index a2358dc..1299ede 100644 --- a/requirements-min.txt +++ b/requirements-min.txt @@ -1,2 +1,2 @@ pynwb -ndx-ophys-devices git+https://github.com/catalystneuro/ndx-ophys-devices.git@create_specs \ No newline at end of file +ndx-ophys-devices git+https://github.com/catalystneuro/ndx-ophys-devices.git@create_specs diff --git a/src/pynwb/ndx_microscopy/__init__.py b/src/pynwb/ndx_microscopy/__init__.py index 1351b27..467f201 100644 --- a/src/pynwb/ndx_microscopy/__init__.py +++ b/src/pynwb/ndx_microscopy/__init__.py @@ -19,12 +19,8 @@ __spec_path = __location_of_this_file.parent.parent.parent / "spec" / f"{extension_name}.namespace.yaml" load_namespaces(str(__spec_path)) -from ndx_ophys_devices import ( - OpticalFilter, - ExcitationSource, - Indicator, - Photodetector, -) +from ndx_ophys_devices import ExcitationSource, Indicator, OpticalFilter, Photodetector + Microscope = get_class("Microscope", extension_name) ExcitationLightPath = get_class("ExcitationLightPath", extension_name) EmissionLightPath = get_class("EmissionLightPath", extension_name) diff --git a/src/pynwb/ndx_microscopy/testing/__init__.py b/src/pynwb/ndx_microscopy/testing/__init__.py index 9b7679e..97ddbba 100644 --- a/src/pynwb/ndx_microscopy/testing/__init__.py +++ b/src/pynwb/ndx_microscopy/testing/__init__.py @@ -1,7 +1,7 @@ from ._mock import ( - mock_Microscope, - mock_ExcitationLightPath, mock_EmissionLightPath, + mock_ExcitationLightPath, + mock_Microscope, mock_MicroscopyPlaneSegmentation, mock_MicroscopySegmentations, mock_MultiChannelMicroscopyVolume, diff --git a/src/pynwb/ndx_microscopy/testing/_mock.py b/src/pynwb/ndx_microscopy/testing/_mock.py index 47b4a64..8b9f024 100644 --- a/src/pynwb/ndx_microscopy/testing/_mock.py +++ b/src/pynwb/ndx_microscopy/testing/_mock.py @@ -3,22 +3,17 @@ import numpy as np import pynwb.base -from pynwb.testing.mock.utils import name_generator - -import ndx_microscopy - -from ndx_ophys_devices import ( - OpticalFilter, - ExcitationSource, - Indicator, - Photodetector, -) +from ndx_ophys_devices import ExcitationSource, Indicator, OpticalFilter, Photodetector from ndx_ophys_devices.testing import ( + mock_ExcitationSource, mock_Indicator, - mock_Photodetector, mock_OpticalFilter, - mock_ExcitationSource, + mock_Photodetector, ) +from pynwb.testing.mock.utils import name_generator + +import ndx_microscopy + def mock_Microscope( *, diff --git a/src/pynwb/tests/test_constructors.py b/src/pynwb/tests/test_constructors.py index 3935c0d..0f5573e 100644 --- a/src/pynwb/tests/test_constructors.py +++ b/src/pynwb/tests/test_constructors.py @@ -4,9 +4,9 @@ import pynwb from ndx_microscopy.testing import ( - mock_Microscope, - mock_ExcitationLightPath, mock_EmissionLightPath, + mock_ExcitationLightPath, + mock_Microscope, mock_MicroscopyPlaneSegmentation, mock_MicroscopySegmentations, mock_MultiChannelMicroscopyVolume, @@ -68,7 +68,10 @@ def test_constructor_planar_microscopy_series(): emission_light_path = mock_EmissionLightPath() mock_PlanarMicroscopySeries( - microscope=microscope, excitation_light_path=excitation_light_path, imaging_space=imaging_space, emission_light_path=emission_light_path + microscope=microscope, + excitation_light_path=excitation_light_path, + imaging_space=imaging_space, + emission_light_path=emission_light_path, ) @@ -79,7 +82,10 @@ def test_constructor_variable_depth_microscopy_series(): emission_light_path = mock_EmissionLightPath() mock_VariableDepthMicroscopySeries( - microscope=microscope, excitation_light_path=excitation_light_path, imaging_space=imaging_space, emission_light_path=emission_light_path + microscope=microscope, + excitation_light_path=excitation_light_path, + imaging_space=imaging_space, + emission_light_path=emission_light_path, ) @@ -90,7 +96,10 @@ def test_constructor_volumetric_microscopy_series(): emission_light_path = mock_EmissionLightPath() mock_VolumetricMicroscopySeries( - microscope=microscope, excitation_light_path=excitation_light_path, imaging_space=imaging_space, emission_light_path=emission_light_path + microscope=microscope, + excitation_light_path=excitation_light_path, + imaging_space=imaging_space, + emission_light_path=emission_light_path, ) @@ -101,7 +110,9 @@ def test_constructor_multi_channel_microscopy_volume(): emission_light_paths = [mock_EmissionLightPath()] excitation_light_paths_used_by_volume = pynwb.base.VectorData( - name="excitation_light_paths", description="Light sources used by this MultiChannelVolume.", data=excitation_light_paths + name="excitation_light_paths", + description="Light sources used by this MultiChannelVolume.", + data=excitation_light_paths, ) emission_light_paths_used_by_volume = pynwb.base.VectorData( name="emission_light_paths", @@ -126,7 +137,9 @@ def test_constructor_variable_depth_multi_channel_microscopy_volume(): emission_light_paths = [mock_EmissionLightPath()] excitation_light_paths_used_by_volume = pynwb.base.VectorData( - name="excitation_light_paths", description="Light sources used by this MultiChannelVolume.", data=excitation_light_paths + name="excitation_light_paths", + description="Light sources used by this MultiChannelVolume.", + data=excitation_light_paths, ) emission_light_paths_used_by_volume = pynwb.base.VectorData( name="emission_light_paths", diff --git a/src/pynwb/tests/test_roundtrip.py b/src/pynwb/tests/test_roundtrip.py index fe5d512..99d2a16 100644 --- a/src/pynwb/tests/test_roundtrip.py +++ b/src/pynwb/tests/test_roundtrip.py @@ -6,9 +6,9 @@ import pynwb from ndx_microscopy.testing import ( - mock_Microscope, - mock_ExcitationLightPath, mock_EmissionLightPath, + mock_ExcitationLightPath, + mock_Microscope, mock_MicroscopyPlaneSegmentation, mock_MicroscopySegmentations, mock_MultiChannelMicroscopyVolume, @@ -199,7 +199,9 @@ def test_roundtrip(self): # TODO: It might be more convenient in Python to have a custom constructor that takes in a list of # light sources and optical channels and does the VectorData wrapping internally excitation_light_paths_used_by_volume = pynwb.base.VectorData( - name="excitation_light_paths", description="Light sources used by this MultiChannelVolume.", data=excitation_light_paths + name="excitation_light_paths", + description="Light sources used by this MultiChannelVolume.", + data=excitation_light_paths, ) emission_light_paths_used_by_volume = pynwb.base.VectorData( name="emission_light_paths",