Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 26, 2024
1 parent 8356ca5 commit 6f23542
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 34 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ classDiagram
class MultiChannelMicroscopyVolume {
<<NWBDataInterface>>
--------------------------------------
attributes
--------------------------------------
Expand All @@ -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{
<<NWBContainer>>
Expand Down
2 changes: 1 addition & 1 deletion requirements-min.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pynwb
ndx-ophys-devices git+https://github.com/catalystneuro/ndx-ophys-devices.git@create_specs
ndx-ophys-devices git+https://github.com/catalystneuro/ndx-ophys-devices.git@create_specs
8 changes: 2 additions & 6 deletions src/pynwb/ndx_microscopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/pynwb/ndx_microscopy/testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ._mock import (
mock_Microscope,
mock_ExcitationLightPath,
mock_EmissionLightPath,
mock_ExcitationLightPath,
mock_Microscope,
mock_MicroscopyPlaneSegmentation,
mock_MicroscopySegmentations,
mock_MultiChannelMicroscopyVolume,
Expand Down
19 changes: 7 additions & 12 deletions src/pynwb/ndx_microscopy/testing/_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
*,
Expand Down
27 changes: 20 additions & 7 deletions src/pynwb/tests/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
)


Expand All @@ -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,
)


Expand All @@ -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,
)


Expand All @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions src/pynwb/tests/test_roundtrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 6f23542

Please sign in to comment.