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 tests to use new metadata format #22

Merged
merged 2 commits into from
Dec 20, 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
16 changes: 0 additions & 16 deletions tests/metadata.yaml

This file was deleted.

22 changes: 12 additions & 10 deletions tests/test_convert_raw_ephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ def test_add_electrode_data():
"""
# Create a test metadata dictionary
metadata = {}
metadata["impedance_file_path"] = "tests/test_data/processed_ephys/impedance.csv"
metadata["channel_geometry_file_path"] = "tests/test_data/processed_ephys/geom.csv"
metadata["electrodes_location"] = "Nucleus Accumbens core"
metadata["device"] = {
metadata["ephys"] = {}
metadata["ephys"]["impedance_file_path"] = "tests/test_data/processed_ephys/impedance.csv"
metadata["ephys"]["channel_geometry_file_path"] = "tests/test_data/processed_ephys/geom.csv"
metadata["ephys"]["electrodes_location"] = "Nucleus Accumbens core"
metadata["ephys"]["device"] = {
"name": "Probe",
"description": "Berke Lab Probe",
"manufacturer": "My Manufacturer",
Expand Down Expand Up @@ -51,7 +52,7 @@ def test_add_electrode_data():
eg = nwbfile.electrode_groups["ElectrodeGroup"]
assert eg is not None
assert eg.description == "All electrodes"
assert eg.location == metadata["electrodes_location"]
assert eg.location == metadata["ephys"]["electrodes_location"]
assert eg.device is device

# Test that the nwbfile has the expected electrodes after filtering
Expand Down Expand Up @@ -111,11 +112,12 @@ def test_add_raw_ephys():
)

metadata = {}
metadata["openephys_folder_path"] = "tests/test_data/raw_ephys/2022-07-25_15-30-00"
metadata["impedance_file_path"] = "tests/test_data/processed_ephys/impedance.csv"
metadata["channel_geometry_file_path"] = "tests/test_data/processed_ephys/geom.csv"
metadata["electrodes_location"] = "Nucleus Accumbens core"
metadata["device"] = {
metadata["ephys"] = {}
metadata["ephys"]["openephys_folder_path"] = "tests/test_data/raw_ephys/2022-07-25_15-30-00"
metadata["ephys"]["impedance_file_path"] = "tests/test_data/processed_ephys/impedance.csv"
metadata["ephys"]["channel_geometry_file_path"] = "tests/test_data/processed_ephys/geom.csv"
metadata["ephys"]["electrodes_location"] = "Nucleus Accumbens core"
metadata["ephys"]["device"] = {
"name": "Probe",
"description": "Berke Lab Probe",
"manufacturer": "My Manufacturer",
Expand Down
5 changes: 3 additions & 2 deletions tests/test_convert_spikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ def test_add_spikes():
`python tests/test_data/create_spike_test_data.py`.
"""
metadata = {}
metadata["mountain_sort_output_file_path"] = "tests/test_data/processed_ephys/firings.mda"
metadata["sampling_frequency"] = 30_000
metadata["ephys"] = {}
metadata["ephys"]["mountain_sort_output_file_path"] = "tests/test_data/processed_ephys/firings.mda"
metadata["ephys"]["sampling_frequency"] = 30_000

nwbfile = NWBFile(
session_description="Mock session",
Expand Down
Loading