Skip to content

Commit

Permalink
Merge pull request #2512 from AllenInstitute/rc/2.13.6
Browse files Browse the repository at this point in the history
Rc/2.13.6
  • Loading branch information
aamster authored Aug 4, 2022
2 parents 22ce96b + daa2256 commit cb4dfbb
Show file tree
Hide file tree
Showing 10 changed files with 4,350 additions and 3,628 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## [2.13.6] = 2022-08-04
- bugfix when accessing stimulus presentations table for vcn data
- updates vbn notebooks
-
## [2.13.5] = 2022-07-27
- Add support for visual behavior neuropixels data
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def get_stimulus_presentations(self):
table = table.value

if "color" in table.columns:
# .loc breaks on nan values so fill with empty string
# This is backwards compatible change for older nwb files
# Newer ones encode nan value here with empty string
table['color'] = table['color'].fillna('')

# the color column actually contains two parameters. One is
# coded as rgb triplets and the other as -1 or 1
if "color_triplet" not in table.columns:
Expand Down
6 changes: 5 additions & 1 deletion allensdk/test/brain_observatory/ecephys/test_write_nwb.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def test_add_metadata(nwbfile, roundtripper, metadata, expected_metadata):
'movie_specific_column': [np.nan, np.nan, np.nan, 1.0, np.nan],
'start_time': [1., 2., 4., 5., 6.],
'stimulus_name': ['gabors', 'gabors', 'random', 'movie', 'gabors'],
'stop_time': [2., 4., 5., 6., 8.]
'stop_time': [2., 4., 5., 6., 8.],
'color': [np.nan] + ['[1.0, 1.0, 1.0]'] * 4
}, index=pd.Index(name='stimulus_presentations_id',
data=[0, 1, 2, 3, 4]))),
])
Expand All @@ -163,6 +164,9 @@ def test_add_stimulus_presentations(nwbfile, presentations, roundtripper):
api = roundtripper(nwbfile, EcephysNwbSessionApi)
obtained_stimulus_table = api.get_stimulus_presentations()

if 'color' in presentations.value:
presentations.value['color_triplet'] = [''] + ['[1.0, 1.0, 1.0]'] * 4
presentations.value['color'] = ''
pd.testing.assert_frame_equal(
presentations.value,
obtained_stimulus_table,
Expand Down
Loading

0 comments on commit cb4dfbb

Please sign in to comment.