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

Issue reading LFP reports #251

Merged
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
10 changes: 5 additions & 5 deletions bluepysnap/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ def _collect_frame_reports(sim):
for name in sim.to_libsonata.list_report_names:
report = sim.to_libsonata.report(name)
report_type = report.sections.name
if report_type == "soma":
from bluepysnap.frame_report import SomaReport

cls = SomaReport
elif report_type == "all":
if report_type == "all" or report.type.name == "lfp":
from bluepysnap.frame_report import CompartmentReport

cls = CompartmentReport
elif report_type == "soma":
from bluepysnap.frame_report import SomaReport

cls = SomaReport
else:
raise BluepySnapError(f"Report {name}: format {report_type} not yet supported.")

Expand Down
8 changes: 8 additions & 0 deletions tests/data/simulation_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@
"end_time": 0.8,
"dt": 0.02,
"file_name": "compartment_named"
},
"lfp_report": {
"cells": "Layer23",
"variable_name": "v",
"type": "lfp",
"start_time": 0.2,
"end_time": 0.8,
"dt": 0.02
}
}
}
3 changes: 2 additions & 1 deletion tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ def test_all():
assert isinstance(simulation.spikes, SpikeReport)
assert isinstance(simulation.spikes["default"], PopulationSpikeReport)

assert set(simulation.reports) == {"soma_report", "section_report"}
assert set(simulation.reports) == {"soma_report", "section_report", "lfp_report"}
assert isinstance(simulation.reports["soma_report"], SomaReport)
assert isinstance(simulation.reports["section_report"], CompartmentReport)
assert isinstance(simulation.reports["lfp_report"], CompartmentReport)

rep = simulation.reports["soma_report"]
assert set(rep.population_names) == {"default", "default2"}
Expand Down