-
Notifications
You must be signed in to change notification settings - Fork 2
Add plot_probability_matching function for list-based trial data #181
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: yangsunhwang <[email protected]>
Co-authored-by: yangsunhwang <[email protected]>
Co-authored-by: yangsunhwang <[email protected]>
…e closing Co-authored-by: yangsunhwang <[email protected]>
|
@copilot --------------------------------------------------------------------------- Cell In[21], line 82, in plot_probability_matching(trial_data, block_data, fig_dir) File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\site-packages\matplotlib\pyplot.py:1042, in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, clear, **kwargs) File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\site-packages\matplotlib\pyplot.py:551, in new_figure_manager(*args, **kwargs) File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\site-packages\matplotlib\pyplot.py:528, in _warn_if_gui_out_of_main_thread() File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\site-packages\matplotlib\pyplot.py:369, in _get_backend_mod() File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\site-packages\matplotlib\pyplot.py:425, in switch_backend(newbackend) File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\site-packages\matplotlib\backends\registry.py:317, in BackendRegistry.load_backend_module(self, backend) File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\importlib_init_.py:90, in import_module(name, package) File :1387, in _gcd_import(name, package, level) File :1360, in find_and_load(name, import) File :1331, in find_and_load_unlocked(name, import) File :935, in _load_unlocked(spec) File :995, in exec_module(self, module) File :488, in _call_with_frames_removed(f, *args, **kwds) File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\site-packages\matplotlib\backends\backend_qtagg.py:9 File c:\Users\yangsunhwang\anaconda3\envs\jdb_to_nwb\Lib\site-packages\matplotlib\backends\qt_compat.py:130 ImportError: Failed to import any of the following Qt binding modules: PyQt6, PySide6, PyQt5, PySide2 not sure we need this qt binding modules? |
The existing
plot_probability_matchingfunction expected pandas DataFrame structure with columns likeport,rwd,block, etc. After refactoring,parse_arduino_textnow returns trial data as a list of dictionaries.Changes
New plotting function (
src/jdb_to_nwb/plotting/plot_behavior.py)trial_data(list of dicts) andblock_data(list of dicts) fromparse_arduino_textTest coverage (
tests/test_convert_behavior.py)Example usage (
examples/plot_probability_matching_example.py)parse_arduino_textworkflowUsage
Trial dict structure:
{ 'end_port': 'B', # Port visited (A/B/C) 'reward': 1, # 1 if rewarded, 0 otherwise 'block': 1, # Block number 'trial_within_session': 3 # Trial index }Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.