jonescompneurolab / hnn-core

Simulation and optimization of neural circuits for MEG/EEG source estimates
https://jonescompneurolab.github.io/hnn-core/
BSD 3-Clause "New" or "Revised" License
50 stars 50 forks source link

GUI: L2 KeyError when running ERPYes100Trials.json #789

Open dylansdaniels opened 3 weeks ago

dylansdaniels commented 3 weeks ago

In dev version of the GUI, I noticed an L2 KeyError when running ERPYes100Trials.json. The plot is still generating correctly, but there's an error with serialize_simulation. See traceback below


KeyError Traceback (most recent call last) File ~/Documents/github_repos/hnn_testing/hnn_core_2/hnn_core/gui/gui.py:1532, in _serialize_simulation(log_out, sim_data, simulation_list_widget) 1530 with log_out: 1531 logger.info(f"Saving {sim_name}.txt") -> 1532 return serialize_simulation(sim_data, sim_name)

File ~/Documents/github_repos/hnn_testing/hnn_core_2/hnn_core/gui/gui.py:1553, in serialize_simulation(simulations_data, simulation_name) 1546 fmt = '%f, %f, %f, %f' 1548 for dpl_trial in simulation_data[simulation_name]['dpls']: 1549 # Combine all data columns at once 1550 signals_matrix = np.column_stack(( 1551 dpl_trial.times, 1552 dpl_trial.data['agg'], -> 1553 dpl_trial.data['L2'], 1554 dpl_trial.data['L5'] 1555 )) 1557 # Using StringIO to collect CSV data 1558 with io.StringIO() as output:

KeyError: 'L2'

jasmainak commented 3 weeks ago

cc @gtdang @kmilo9999

gtdang commented 3 weeks ago

What is the data file you are using? Is it from the hnn-data repo? If so those are hierarchical json format, which hasn't been integrated in the new gui yet.