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

Fix get_condition_method for round trip. #20

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/pynwb/ndx_binned_spikes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def get_data_for_condition(self, condition_index):
if not self.has_multiple_conditions:
return self.data

mask = self.condition_indices == condition_index
mask = self.condition_indices[:] == condition_index
binned_spikes_for_unit = self.data[:, mask, :]

return binned_spikes_for_unit
Expand Down
5 changes: 5 additions & 0 deletions src/pynwb/tests/test_binned_aligned_spikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ def test_roundtrip_acquisition(self):
assert read_binned_aligned_spikes.number_of_bins == number_of_bins
assert read_binned_aligned_spikes.number_of_events == number_of_events
assert read_binned_aligned_spikes.number_of_conditions == number_of_conditions

expected_data_condition1 = self.binned_aligned_spikes.get_data_for_condition(condition_index=2)
data_condition1 = read_binned_aligned_spikes.get_data_for_condition(condition_index=2)

np.testing.assert_equal(data_condition1, expected_data_condition1)

def test_roundtrip_processing_module(self):
self.binned_aligned_spikes = mock_BinnedAlignedSpikes()
Expand Down
Loading