Skip to content

Commit

Permalink
add testing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zm711 committed Oct 19, 2023
1 parent 73a96f5 commit dc57444
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Binary file added test/test_data/channel_map.npy
Binary file not shown.
18 changes: 18 additions & 0 deletions test/test_merged_spike_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,21 @@ def test_merge_z_score(sa):

test_merged_msa.set_stimulus_data()
test_merged_msa.set_spike_data()

sa.events = {
"0": {
"events": np.array([100, 200]),
"lengths": np.array([100, 100]),
"trial_groups": np.array([1, 1]),
"stim": "test",
}
}
sa.get_raw_psth(window=[0, 300], time_bin_ms=50)
sa.get_raw_firing_rate(time_bin_ms=1000, bsl_window=None, fr_window=[0, 300], mode="raw")
sa.z_score_data(time_bin_ms=1000, bsl_window=[0, 50], z_window=[0, 300])

test_msa = MergedSpikeAnalysis([sa, sa], name_list=["test", "test1"])
test_msa.merge(psth=["zscore", "fr"])
test_merged_msa = test_msa.get_merged_data()

assert isinstance(test_merged_msa.mean_firing_rate, dict)
6 changes: 6 additions & 0 deletions test/test_spike_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ def test_get_waveforms_read_json(spikes, tmp_path):
assert isinstance(spikes.waveforms, np.ndarray)


def test_get_waveforms_binary(spikes):
spikes.get_waveforms()
print(spikes.waveforms)
assert isinstance(spikes.waveforms, np.ndarray)


def test_set_qc_error(spikes):
with pytest.raises(Exception):
spikes.set_qc()
Expand Down

0 comments on commit dc57444

Please sign in to comment.