Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update extension with optional columns #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
[![Build Status](https://travis-ci.com/akshay-jaggi/ndx-photometry.svg?branch=master)](https://travis-ci.com/akshay-jaggi/ndx-photometry)
[![Documentation Status](https://readthedocs.org/projects/ndx-photometry/badge/?version=latest)](https://ndx-photometry.readthedocs.io/en/latest/?badge=latest)

![NWB - Photometry](https://user-images.githubusercontent.com/844306/144680873-3e2d957f-97ff-45cb-b625-517f5e7dfb9f.png)

## Introduction
This is an NWB extension for storing photometry recordings and associated metadata. This extension stores photometry information across three folders in the NWB file: acquisition, processing, and general. The acquisiton folder contains an ROIResponseSeries (inherited from `pynwb.ophys`), which references rows of a FibersTable rather than 2 Photon ROIs. The new types for this extension are in metadata and processing

Expand Down Expand Up @@ -67,6 +69,7 @@ commandedvoltage_series = (
frequency=30.0,
power=500.0,
rate=30.0,
unit="volts",
)
)

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

setup_args = {
'name': 'ndx-photometry',
'version': '0.1.0',
'version': '0.1.1',
'description': 'extension for fiber photometry data',
'long_description': readme,
'long_description_content_type': readme_type,
Expand All @@ -33,7 +33,7 @@
'install_requires': [
'pynwb>=1.3.0',
'numpy<1.19.4',
'h5py<3'
'h5py',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bendichter
I couldn't install ndx-photometry with h5py<3, had legacy-install-failure error for it.
The version that this installs with is 3.8.0.

],
'packages': find_packages('src/pynwb'),
'package_dir': {'': 'src/pynwb'},
Expand Down
5 changes: 5 additions & 0 deletions spec/ndx-photometry.extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ groups:
shape:
- null
doc: peak wavelength of photodetector
quantity: '?'
attributes:
- name: unit
dtype: text
Expand All @@ -75,6 +76,7 @@ groups:
shape:
- null
doc: gain on the photodetector
quantity: '?'
- name: model_number
neurodata_type_inc: VectorData
dtype: text
Expand Down Expand Up @@ -112,6 +114,7 @@ groups:
shape:
- null
doc: references CommandedVoltageSeries
quantity: '?'
- name: output
neurodata_type_inc: VectorData
dtype: float
Expand Down Expand Up @@ -143,6 +146,7 @@ groups:
- name: frequency
dtype: float
doc: voltage frequency in unit hertz
quantity: '?'
Comment on lines 146 to +149
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this optional for now, but feels a duplication with rate of TimeSeries.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be referring to the frequency of the alternating current, e.g. 60 Hz in the US and 50 Hz in Europe

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but maybe not, I don't really remember

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, is it okay to leave it optional or rollback?

attributes:
- name: unit
dtype: text
Expand Down Expand Up @@ -202,6 +206,7 @@ groups:
- name: commanded_voltages
neurodata_type_inc: MultiCommandedVoltage
doc: multiple commanded voltage container
quantity: '?'
- neurodata_type_def: FluorophoresTable
neurodata_type_inc: DynamicTable
name: fluorophores
Expand Down
8 changes: 4 additions & 4 deletions src/pynwb/tests/integration/test_photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def test_roundtrip(self):
commandedvoltage_series2 = (
multi_commanded_voltage.create_commanded_voltage_series(
name="commanded_voltage2",
data=[1.0, 2.0, 3.0],
frequency=30.0,
power=500.0,
data=[4.0, 5.0, 6.0],
power=400.0,
rate=30.0,
unit="volts",
)
)

Expand Down Expand Up @@ -102,7 +102,7 @@ def test_roundtrip(self):
name="roi_response_series",
description="my roi response series",
data=np.random.randn(100, 1),
unit = 'F',
unit='F',
rate=30.0,
rois=fibers_ref,
)
Expand Down
7 changes: 6 additions & 1 deletion src/spec/create_extension_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def main():
dtype="float",
shape=(None,),
neurodata_type_inc="VectorData",
quantity="?",
attributes=[
NWBAttributeSpec(
name="unit", doc="wavelength unit", value="nanometers", dtype="text"
Expand All @@ -146,6 +147,7 @@ def main():
dtype="float",
shape=(None,),
neurodata_type_inc="VectorData",
quantity="?",
),
NWBDatasetSpec(
name="model_number",
Expand Down Expand Up @@ -191,6 +193,7 @@ def main():
),
shape=(None,),
neurodata_type_inc="VectorData",
quantity="?",
),
NWBDatasetSpec(
name="output",
Expand Down Expand Up @@ -236,6 +239,7 @@ def main():
name="unit", doc="frequency unit", value="hertz", dtype="text"
)
],
quantity="?",
),
NWBDatasetSpec(
name="power",
Expand Down Expand Up @@ -354,7 +358,8 @@ def main():
NWBGroupSpec(
name='commanded_voltages',
neurodata_type_inc='MultiCommandedVoltage',
doc='multiple commanded voltage container'
doc='multiple commanded voltage container',
quantity="?",
)
]
)
Expand Down