Skip to content

Commit a5c19d0

Browse files
authored
Use PyNWB autogen classes instead of handwritten classes (#3)
1 parent b6b6930 commit a5c19d0

19 files changed

+154
-393
lines changed

README.md

Lines changed: 90 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# ndx-franklab-novela Extension for NWB
22

33
# About
4-
ndx-franklab-novela is a python package containing NWB custom extensions.
4+
ndx-franklab-novela is a python package containing NWB custom extensions for Loren Frank's Lab.
5+
6+
# How to install
7+
8+
Add ndx-franklab-novela to your conda environment
9+
10+
`pip install git+git://github.com/LorenFrankLab/ndx-franklab-novela`
11+
12+
The original published extension maintained by NovelaNeuro can be installed using:
13+
14+
`conda install -c conda-forge -c novelakrk ndx-franklab-novela`
15+
516

617
# How to install
718

@@ -14,75 +25,83 @@ The original published extension maintained by NovelaNeuro can be installed usin
1425

1526
# Extensions
1627

17-
### AssociatedFiles
18-
Representation of associated files in NWB <br>
19-
**Attributes:** <br>
20-
**description** `string`: description of associated file <br>
21-
**content** `string`: content of associated file <br>
22-
**task_epochs** `string`: id of epochs with task that is descripted by associated files <br>
23-
24-
#### HeaderDevice
25-
Representation of HeaderDevice in NWB. <br>
26-
**Attributes:** <br>
27-
**headstage_serial** `string`: headstage_serial from header global configuration <br>
28-
**headstage_smart_ref_on** `string`: headstage_smart_ref_on from header global configuration <br>
29-
**realtime_mode** `string`: realtime_mode from header global configuration <br>
30-
**headstage_auto_settle_on** `string`: headstage_auto_settle_on from header global configuration <br>
31-
**timestamp_at_creation** `string`: timestamp_at_creation from header global configuration <br>
32-
**controller_firmware_version** `string`: conntroller_firmware_version from header global configuration <br>
33-
**controller_serial** `string`: conntroller_serial from header global configuration <br>
34-
**save_displayed_chan_only** `string`: save_displayed_chan_only from header global configuration <br>
35-
**headstage_firmware_version** `string`: headstage_firmware_version from header global configuration <br>
36-
**qt_version** `string`: qt_version from header global configuration <br>
37-
**compile_date** `string`: compile_date from header global configuration <br>
38-
**compile_time** `string`: compile_time from header global configuration <br>
39-
**file_prefix** `string`: file_prefix from header global configuration <br>
40-
**headstage_gyro_sensor_on** `string`: headstage_gyro_sensor_on from header global configuration <br>
41-
**headstage_mag_sensor_on** `string`: headstage_mag_sensor_on from header global configuration <br>
42-
**trodes_version** `string`: trodes_version from header global configuration <br>
43-
**headstage_accel_sensor_on** `string`: headstage_accel_sensor_on from header global configuration <br>
44-
**commit_head** `string`: commit_head from header global configuration <br>
45-
**system_time_at_creation** `string`: system_time_at_creation from header global configuration <br>
46-
**file_path** `string`: file_path from header global configuration <br>
47-
48-
#### ShanksElectrode
49-
Representation of ShanksElectrode object in NWB <br>
50-
**Attributes:** <br>
51-
**name** `string`: name of the shank <br>
52-
**rel_x** `float`: the rel_x value of this electrode <br>
53-
**rel_y** `float`: the rel_y value of this electrode <br>
54-
**rel_z** `float`: the rel_z value of this electrode of p
55-
56-
#### Shank
57-
Representation of Shank object in NWB <br>
58-
**Attributes:** <br>
59-
**name** `string`: name of the shank <br>
60-
**shanks_electrodes** `list`,`tuple`: 'electrodes in shank', 'default': list() <br>
61-
62-
#### Probe
63-
Representation of Probe object in NWB <br>
64-
**Attributes:** <br>
65-
**id** `int`: unique id of the probe <br>
66-
**probe_type** `string`: type of probe <br>
67-
**units** `string`: units in device <br>
68-
**probe_description** `string`: probe_description of probe <br>
69-
**contact_side_numbering** `bool`: is contact_side_numbering enabled <br>
70-
**contact_size** `float`: value of contact size as float <br>
71-
**shanks** `object`: shanks in the probe <br>
72-
73-
#### DataAcqDevice
74-
Representation of DataAcqDevice object in NWB <br>
75-
**Attributes:** <br>
76-
**system** `string`: system of device <br>
77-
**amplifier** `string`: amplifier (default: '') <br>
78-
**adc_circuit** `string`: adc_circuit (default: '') <br>
79-
80-
#### CameraDevice
81-
Representation of CameraDevice object in NWB <br>
82-
**Attributes:** <br>
83-
**meters_per_pixel** `float`: meter per pixel <br>
84-
**model** `string`: model of this camera device <br>
85-
**lens** `string`: info about lens in this camera <br>
86-
**camera_name** `string`: name of this camera <br>
28+
## AssociatedFiles
29+
Representation of associated files in NWB.
30+
31+
**Attributes:**
32+
- **description** `string`: description of associated file
33+
- **content** `string`: content of associated file
34+
- **task_epochs** `string`: id of epochs with task that is descripted by associated files
35+
36+
## HeaderDevice
37+
Representation of HeaderDevice in NWB.
38+
39+
**Attributes:**
40+
- **headstage_serial** `string`: headstage_serial from header global configuration
41+
- **headstage_smart_ref_on** `string`: headstage_smart_ref_on from header global configuration
42+
- **realtime_mode** `string`: realtime_mode from header global configuration
43+
- **headstage_auto_settle_on** `string`: headstage_auto_settle_on from header global configuration
44+
- **timestamp_at_creation** `string`: timestamp_at_creation from header global configuration
45+
- **controller_firmware_version** `string`: conntroller_firmware_version from header global configuration
46+
- **controller_serial** `string`: conntroller_serial from header global configuration
47+
- **save_displayed_chan_only** `string`: save_displayed_chan_only from header global configuration
48+
- **headstage_firmware_version** `string`: headstage_firmware_version from header global configuration
49+
- **qt_version** `string`: qt_version from header global configuration
50+
- **compile_date** `string`: compile_date from header global configuration
51+
- **compile_time** `string`: compile_time from header global configuration
52+
- **file_prefix** `string`: file_prefix from header global configuration
53+
- **headstage_gyro_sensor_on** `string`: headstage_gyro_sensor_on from header global configuration
54+
- **headstage_mag_sensor_on** `string`: headstage_mag_sensor_on from header global configuration
55+
- **trodes_version** `string`: trodes_version from header global configuration
56+
- **headstage_accel_sensor_on** `string`: headstage_accel_sensor_on from header global configuration
57+
- **commit_head** `string`: commit_head from header global configuration
58+
- **system_time_at_creation** `string`: system_time_at_creation from header global configuration
59+
- **file_path** `string`: file_path from header global configuration
60+
61+
## ShanksElectrode
62+
Representation of electrodes of a shank in NWB.
63+
64+
**Attributes:**
65+
- **name** `string`: name of the shank
66+
- **rel_x** `float`: the rel_x value of this electrode
67+
- **rel_y** `float`: the rel_y value of this electrode
68+
- **rel_z** `float`: the rel_z value of this electrode
69+
70+
## Shank
71+
Representation of a shank in NWB.
72+
73+
**Attributes:**
74+
- **name** `string`: name of the shank
75+
- **shanks_electrodes** `dict`: electrodes in the shank
76+
77+
## Probe
78+
Representation of a probe in NWB.
79+
80+
**Attributes:**
81+
- **id** `int`: unique id of the probe
82+
- **probe_type** `string`: type of probe
83+
- **units** `string`: units in device
84+
- **probe_description** `string`: description of probe
85+
- **contact_side_numbering** `bool`: is contact_side_numbering enabled
86+
- **contact_size** `float`: value of contact size as float
87+
- **shanks** `dict`: shanks in the probe
88+
89+
## DataAcqDevice
90+
Representation of data acquisition device in NWB.
91+
92+
**Attributes:**
93+
- **system** `string`: system of device
94+
- **amplifier** `string`: amplifier (optional)
95+
- **adc_circuit** `string`: adc_circuit (optional)
96+
97+
## CameraDevice
98+
Representation of a camera device in NWB.
99+
100+
**Attributes:**
101+
- **meters_per_pixel** `float`: meters per pixel
102+
- **model** `string`: model of this camera device
103+
- **lens** `string`: info about lens in this camera
104+
- **camera_name** `string`: name of this camera
87105

106+
---
88107
This extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).

setup.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# -*- coding: utf-8 -*-
2-
3-
version = "0.0.011.36"
4-
print(version)
5-
62
import os
73
from shutil import copy2
84

95
from setuptools import find_packages, setup
106

7+
version = "0.1.0"
8+
print(version)
9+
1110
# load README.md/README.rst file
1211
try:
1312
if os.path.exists('README.md'):
@@ -20,7 +19,7 @@
2019
readme_type = 'text/x-rst; charset=UTF-8'
2120
else:
2221
readme = ""
23-
except:
22+
except Exception:
2423
readme = ""
2524

2625
setup_args = {

spec/ndx-franklab-novela.extensions.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ groups:
6262
- name: amplifier
6363
dtype: text
6464
doc: amplifier
65+
required: false
6566
- name: adc_circuit
6667
dtype: text
6768
doc: adc_circuit
69+
required: false
6870
- neurodata_type_def: CameraDevice
6971
neurodata_type_inc: Device
7072
doc: A custom Device interface

spec/ndx-franklab-novela.namespace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespaces:
66
- Ryan Ly
77
contact:
88
9-
- loren@cin.ucsf.edu
9+
- loren.frank@ucsf.edu
1010
1111
1212
doc: NWB extension to store additional metadata and data types for Loren Frank's

src/pynwb/ndx_franklab_novela/__init__.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
from pynwb import load_namespaces
3+
from pynwb import load_namespaces, get_class
44

55
# Set path of the namespace.yaml file to the expected install location
66

@@ -23,9 +23,17 @@
2323
# Load the namespace
2424
load_namespaces(ndx_franklab_novela_specpath)
2525

26-
from .associated_files import AssociatedFiles
27-
from .camera_device import CameraDevice
28-
from .data_acq_device import DataAcqDevice
29-
from .header_device import HeaderDevice
30-
from .nwb_electrode_group import NwbElectrodeGroup
31-
from .probe import Probe, Shank, ShanksElectrode
26+
AssociatedFiles = get_class('AssociatedFiles', 'ndx-franklab-novela')
27+
CameraDevice = get_class('CameraDevice', 'ndx-franklab-novela')
28+
DataAcqDevice = get_class('DataAcqDevice', 'ndx-franklab-novela')
29+
HeaderDevice = get_class('HeaderDevice', 'ndx-franklab-novela')
30+
NwbElectrodeGroup = get_class('NwbElectrodeGroup', 'ndx-franklab-novela')
31+
Probe = get_class('Probe', 'ndx-franklab-novela')
32+
Shank = get_class('Shank', 'ndx-franklab-novela')
33+
ShanksElectrode = get_class('ShanksElectrode', 'ndx-franklab-novela')
34+
35+
# define aliases to maintain backward compatibility
36+
Probe.add_shank = Probe.add_shanks
37+
Probe.get_shank = Probe.get_shanks
38+
Shank.add_shanks_electrode = Shank.add_shanks_electrodes
39+
Shank.get_shanks_electrode = Shank.get_shanks_electrodes

src/pynwb/ndx_franklab_novela/associated_files.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/pynwb/ndx_franklab_novela/camera_device.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/pynwb/ndx_franklab_novela/data_acq_device.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)