Skip to content

Commit

Permalink
Merge pull request #983 from t-b/icephys-fixes
Browse files Browse the repository at this point in the history
Icephys fixes
  • Loading branch information
bendichter authored Jul 9, 2019
2 parents b346401 + a796dfd commit 92a0463
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
3 changes: 1 addition & 2 deletions docs/gallery/domain/icephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@
name='vcs', data=[0.1, 0.2, 0.3, 0.4, 0.5],
unit='A', conversion=1e-12, resolution=np.nan, starting_time=123.6, rate=20e3,
electrode=elec, gain=0.02, capacitance_slow=100e-12, resistance_comp_correction=70.0,
capacitance_fast=np.nan, resistance_comp_bandwidth=np.nan, resistance_comp_prediction=np.nan,
whole_cell_capacitance_comp=np.nan, whole_cell_series_resistance_comp=np.nan, sweep_number=15)
sweep_number=15)

nwbfile.add_acquisition(vcs)

Expand Down
4 changes: 2 additions & 2 deletions src/pynwb/data/nwb.icephys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ groups:
attributes:
- name: unit
dtype: text
default_value: pecent
default_value: percent
doc: "The base unit of measure used to store data. This should be in the SI\
\ unit. COMMENT: This is the SI unit (when appropriate) of the stored data,\
\ such as Volts. If the actual data is stored in millivolts, the field 'conversion'\
Expand All @@ -151,7 +151,7 @@ groups:
attributes:
- name: unit
dtype: text
default_value: pecent
default_value: percent
doc: "The base unit of measure used to store data. This should be in the SI\
\ unit. COMMENT: This is the SI unit (when appropriate) of the stored data,\
\ such as Volts. If the actual data is stored in millivolts, the field 'conversion'\
Expand Down
20 changes: 10 additions & 10 deletions src/pynwb/icephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ class CurrentClampSeries(PatchClampSeries):
{'name': 'gain', 'type': float, 'doc': 'Units: Volt/Amp (v-clamp) or Volt/Volt (c-clamp)'},
{'name': 'stimulus_description', 'type': str, 'doc': 'the stimulus name/protocol', 'default': "NA"},
{'name': 'bias_current', 'type': float, 'doc': 'Unit: Amp'},
{'name': 'bridge_balance', 'type': float, 'doc': 'Unit: Ohm'},
{'name': 'capacitance_compensation', 'type': float, 'doc': 'Unit: Farad'},
{'name': 'bias_current', 'type': float, 'doc': 'Unit: Amp', 'default': None},
{'name': 'bridge_balance', 'type': float, 'doc': 'Unit: Ohm', 'default': None},
{'name': 'capacitance_compensation', 'type': float, 'doc': 'Unit: Farad', 'default': None},
{'name': 'resolution', 'type': float,
'doc': 'The smallest meaningful difference (in specified unit) between values in data',
Expand Down Expand Up @@ -322,13 +322,13 @@ class VoltageClampSeries(PatchClampSeries):
apply or record this data.'},
{'name': 'gain', 'type': float, 'doc': 'Units: Volt/Amp (v-clamp) or Volt/Volt (c-clamp)'},
{'name': 'stimulus_description', 'type': str, 'doc': 'the stimulus name/protocol', 'default': "NA"},
{'name': 'capacitance_fast', 'type': float, 'doc': 'Unit: Farad'},
{'name': 'capacitance_slow', 'type': float, 'doc': 'Unit: Farad'},
{'name': 'resistance_comp_bandwidth', 'type': float, 'doc': 'Unit: Hz'},
{'name': 'resistance_comp_correction', 'type': float, 'doc': 'Unit: %'},
{'name': 'resistance_comp_prediction', 'type': float, 'doc': 'Unit: %'},
{'name': 'whole_cell_capacitance_comp', 'type': float, 'doc': 'Unit: Farad'},
{'name': 'whole_cell_series_resistance_comp', 'type': float, 'doc': 'Unit: Ohm'},
{'name': 'capacitance_fast', 'type': float, 'doc': 'Unit: Farad', 'default': None},
{'name': 'capacitance_slow', 'type': float, 'doc': 'Unit: Farad', 'default': None},
{'name': 'resistance_comp_bandwidth', 'type': float, 'doc': 'Unit: Hz', 'default': None},
{'name': 'resistance_comp_correction', 'type': float, 'doc': 'Unit: %', 'default': None},
{'name': 'resistance_comp_prediction', 'type': float, 'doc': 'Unit: %', 'default': None},
{'name': 'whole_cell_capacitance_comp', 'type': float, 'doc': 'Unit: Farad', 'default': None},
{'name': 'whole_cell_series_resistance_comp', 'type': float, 'doc': 'Unit: Ohm', 'default': None},
{'name': 'resolution', 'type': float,
'doc': 'The smallest meaningful difference (in specified unit) between values in data',
'default': _default_resolution},
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/test_icephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ def test_init(self):
electrode_name = GetElectrode()

cCS = CurrentClampSeries('test_cCS', list(), 'unit',
electrode_name, 1.0, 2.0, 3.0, 4.0, timestamps=list())
electrode_name, 1.0, "stimset", 2.0, 3.0, 4.0, timestamps=list())
self.assertEqual(cCS.name, 'test_cCS')
self.assertEqual(cCS.unit, 'unit')
self.assertEqual(cCS.electrode, electrode_name)
self.assertEqual(cCS.stimulus_description, "stimset")
self.assertEqual(cCS.gain, 1.0)
self.assertEqual(cCS.bias_current, 2.0)
self.assertEqual(cCS.bridge_balance, 3.0)
Expand Down Expand Up @@ -145,10 +146,11 @@ def test_init(self):
electrode_name = GetElectrode()

vCS = VoltageClampSeries('test_vCS', list(), 'unit', electrode_name,
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, timestamps=list())
1.0, "stimset", 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, timestamps=list())
self.assertEqual(vCS.name, 'test_vCS')
self.assertEqual(vCS.unit, 'unit')
self.assertEqual(vCS.electrode, electrode_name)
self.assertEqual(vCS.stimulus_description, "stimset")
self.assertEqual(vCS.gain, 1.0)
self.assertEqual(vCS.capacitance_fast, 2.0)
self.assertEqual(vCS.capacitance_slow, 3.0)
Expand Down

0 comments on commit 92a0463

Please sign in to comment.