Skip to content

Commit

Permalink
remove Microscope object
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandratrapani committed Aug 20, 2024
1 parent 1bb58da commit a426f08
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 65 deletions.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classDiagram
label : text
description : text, optional
manufacturer : text, optional
injection_location : text, optional
injection_brain_region : text, optional
injection_coordinates_in_mm : numeric, length 3, optional
}
class Effector{
Expand All @@ -41,7 +41,7 @@ classDiagram
label : text
description : text, optional
manufacturer : text, optional
injection_location : text, optional
injection_brain_region : text, optional
injection_coordinates_in_mm : numeric, length 3, optional
}
```
Expand Down Expand Up @@ -139,6 +139,7 @@ classDiagram
detector_type : text, optional
detected_wavelength_in_nm : numeric, optional
gain : numeric, optional
gain_unit : text, false
}
class ObjectiveLens{
<<DeviceModel>>
Expand All @@ -148,18 +149,10 @@ classDiagram
numerical_aperture : numeric, optional
magnification : numeric, optional
}
class Microscope{
<<DeviceModel>>
--------------------------------------
attributes
--------------------------------------
microscopy_type : text, optional
doi : text, optional
}
ExcitationSource *-- DeviceModel : extends
PulsedExcitationSource *-- ExcitationSource : extends
Photodetector *-- DeviceModel : extends
Microscope *-- DeviceModel : extends
ObjectiveLens *-- DeviceModel : extends
OpticalFilter *-- DeviceModel : extends
BandOpticalFilter *-- OpticalFilter : extends
Expand Down
29 changes: 11 additions & 18 deletions spec/ndx-ophys-devices.extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ groups:
doc: Indicator standard notation.
- name: description
dtype: text
doc: Effector description.
doc: Indicator description.
required: false
- name: manufacturer
dtype: text
doc: Effector manufacturer.
doc: Indicator manufacturer.
required: false
- name: injection_location
- name: injection_brain_region
dtype: text
doc: Injection brain region name.
required: false
Expand Down Expand Up @@ -101,6 +101,11 @@ groups:
- name: gain
dtype: float
doc: Gain on the photodetector.
required: false
- name: gain_unit
dtype: text
doc: Gain on the photodetector.
required: false
- neurodata_type_def: DichroicMirror
neurodata_type_inc: DeviceModel
doc: Extends DeviceModel to hold a Dichroic Mirror.
Expand Down Expand Up @@ -202,7 +207,7 @@ groups:
dtype: text
doc: Effector manufacturer.
required: false
- name: injection_location
- name: injection_brain_region
dtype: text
doc: Injection brain region name.
required: false
Expand All @@ -211,19 +216,7 @@ groups:
shape:
- 3
doc:
Indicator injection location in stereotactic coordinates (AP, ML, DV) mm
Effector injection location in stereotactic coordinates (AP, ML, DV) mm
relative to Bregma.
required: false
- neurodata_type_def: Microscope
neurodata_type_inc: DeviceModel
doc: Extends DeviceModel to hold a Microscope.
attributes:
- name: microscopy_type
dtype: text
doc:
Type of microscope used to capture the image (e.g., inverted, upright, light
sheet, confocal, two photon).
- name: doi
dtype: text
doc: The publication link for custom-built microscope.
required: false

2 changes: 0 additions & 2 deletions src/pynwb/ndx_ophys_devices/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
mock_ObjectiveLens,
mock_ExcitationSource,
mock_PulsedExcitationSource,
mock_Microscope,
)

__all__ = [
Expand All @@ -27,5 +26,4 @@
"mock_ObjectiveLens",
"mock_ExcitationSource",
"mock_PulsedExcitationSource",
"mock_Microscope",
]
28 changes: 6 additions & 22 deletions src/pynwb/ndx_ophys_devices/testing/_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ def mock_Indicator(
description: str = "This is a mock instance of a Indicator type to be used for rapid testing.",
manufacturer: str = "A fake manufacturer of the mock indicator.",
label: str = "A fake label of the indicator.",
injection_location: str = "A fake injection location of the indicator.",
injection_brain_region: str = "A fake injection brain region of the indicator.",
injection_coordinates_in_mm: list = [3.0, 2.0, 1.0],
) -> ndx_ophys_devices.Indicator:
indicator = ndx_ophys_devices.Indicator(
name=name or name_generator("Indicator"),
description=description,
manufacturer=manufacturer,
label=label,
injection_location=injection_location,
injection_brain_region=injection_brain_region,
injection_coordinates_in_mm=injection_coordinates_in_mm,
)
return indicator
Expand All @@ -47,15 +47,15 @@ def mock_Effector(
description: str = "This is a mock instance of a Effector type to be used for rapid testing.",
manufacturer: str = "A fake manufacturer of the mock effector.",
label: str = "A fake label of the effector.",
injection_location: str = "A fake injection location of the effector.",
injection_brain_region: str = "A fake injection brain region of the effector.",
injection_coordinates_in_mm: list = [3.0, 2.0, 1.0],
) -> ndx_ophys_devices.Effector:
effector = ndx_ophys_devices.Effector(
name=name or name_generator("Effector"),
description=description,
manufacturer=manufacturer,
label=label,
injection_location=injection_location,
injection_brain_region=injection_brain_region,
injection_coordinates_in_mm=injection_coordinates_in_mm,
)
return effector
Expand Down Expand Up @@ -90,6 +90,7 @@ def mock_Photodetector(
detector_type: str = "PMT",
detected_wavelength_in_nm: float = 520.0,
gain: float = 100.0,
gain_unit: str = "A/W",
) -> ndx_ophys_devices.Photodetector:
photodetector = ndx_ophys_devices.Photodetector(
name=name or name_generator("Photodetector"),
Expand All @@ -99,6 +100,7 @@ def mock_Photodetector(
detector_type=detector_type,
detected_wavelength_in_nm=detected_wavelength_in_nm,
gain=gain,
gain_unit=gain_unit,
)
return photodetector

Expand Down Expand Up @@ -215,24 +217,6 @@ def mock_ObjectiveLens(
return objective_lens


def mock_Microscope(
*,
name: Optional[str] = None,
description: str = "This is a mock instance of a Microscope type to be used for rapid testing.",
manufacturer: str = "A fake manufacturer of the mock microscope.",
model: str = "A fake model of the mock microscope.",
microscopy_type: str = "Two photon.",
) -> ndx_ophys_devices.Microscope:
microscope = ndx_ophys_devices.Microscope(
name=name or name_generator("Microscope"),
description=description,
manufacturer=manufacturer,
model=model,
microscopy_type=microscopy_type,
)
return microscope


def mock_ExcitationSource(
*,
name: Optional[str] = None,
Expand Down
5 changes: 0 additions & 5 deletions src/pynwb/tests/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
mock_ObjectiveLens,
mock_ExcitationSource,
mock_PulsedExcitationSource,
mock_Microscope,
)


Expand Down Expand Up @@ -59,10 +58,6 @@ def test_constructor_objective_lens():
mock_ObjectiveLens()


def test_constructor_microscope():
mock_Microscope()


def test_constructor_excitation_source():
mock_ExcitationSource()

Expand Down
8 changes: 1 addition & 7 deletions src/pynwb/tests/test_ophysdevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
mock_ObjectiveLens,
mock_ExcitationSource,
mock_PulsedExcitationSource,
mock_Microscope,
)


Expand Down Expand Up @@ -59,10 +58,6 @@ def test_constructor_objective_lens():
mock_ObjectiveLens()


def test_constructor_microscope():
mock_Microscope()


def test_constructor_excitation_source():
mock_ExcitationSource()

Expand All @@ -72,7 +67,7 @@ def test_constructor_pulsed_excitation_source():


@pytest.fixture(scope="module")
def nwbfile_with_microscopy():
def nwbfile_with_ophys_devices():
nwbfile = mock_NWBFile()

mock_DeviceModel()
Expand All @@ -87,7 +82,6 @@ def nwbfile_with_microscopy():
mock_EdgeOpticalFilter()
mock_Effector()
mock_ObjectiveLens()
mock_Microscope()

return nwbfile

Expand Down

0 comments on commit a426f08

Please sign in to comment.