Open HenryJFlynn opened 1 year ago
Some of the functionalities i am looking for may be plugins for pybpod already
^^ messing around with plugins. Adding one the list in user settings some how disables the gui emulator one. The Test Protocol IO
button is no longer there
I have messed something up. I am now getting this error https://github.com/HenryJFlynn/mouse2afc/issues/10#issuecomment-1611227844
^^ matlab also is not working.
It seems that the error has something to do with arduino and the firmware. Re-uploading the firmware to the board fixed the issue
Messing with the plugins, i think a formatting mistake made them not work. I got them working then a bunch of random problems started happening. Got an error bout loading past session data, got errors as if I wasn't in emulator mode when I was. Pybpod starting freezing. I get just restarting terminal and even my computer. Now i can run the protocol but the console does not display any information
^^ i think a cause is I tried using the virtual mouse.
^^ The virtual mouse works,but once you try to end the trial it freezes pybpod. I then close the program and restart. Opening back up again I get this error:
An error occurred when trying to load the info for session [20230629-105105].
Traceback (most recent call last):
File "/home/henry/Documents/chris-pybpod/base/pybpod-gui-plugin/pybpodgui_plugin/models/session/session_window.py", line 64, in load
Session.load(self, path)
File "/home/henry/Documents/chris-pybpod/base/pybpod-gui-api/pybpodgui_api/models/session/session_io.py", line 92, in load
csvreader = self.load_info()
File "/home/henry/Documents/chris-pybpod/base/pybpod-gui-api/pybpodgui_api/models/session/session_io.py", line 141, in load_info
for row in csvreader:
File "/home/henry/Documents/chris-pybpod/libraries/safe-collaborative-architecture/sca/formats/csv.py", line 106, in __next__
self._read_metadata = self.__checkfor_flags(row)
File "/home/henry/Documents/chris-pybpod/libraries/safe-collaborative-architecture/sca/formats/csv.py", line 112, in __checkfor_flags
if len(row)==0: return False
TypeError: object of type 'NoneType' has no len()
I also just got another error, after this one:
They both existed as their own pop out window
I run protocol but the console does not update. In terminal I get this as an output:
Before StateMatrix()
Before send_state_machine()
Before run_state_machine()
Before StateMatrix()
Before send_state_machine()
Before run_state_machine()
Usually there is no output in terminal. The lines shown are usually in console between each are many other lines full of trial data
Messing with the plugins, i think a formatting mistake made them not work. I got them working then a bunch of random problems started happening. Got an error bout loading past session data, got errors as if I wasn't in emulator mode when I was. Pybpod starting freezing. I get just restarting terminal and even my computer. Now i can run the protocol but the console does not display any information
example of an error:
File "/home/henry/Documents/pybpod-project/tasks/emulator_mouse2afc_example/emulator_mouse2afc_example.py", line 7, in <module>
bpod = Bpod(emulator_mode=True)
File "/home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/bpod/bpod_io.py", line 26, in __init__
super(BpodIO, self).__init__(serial_port, sync_channel, sync_mode, emulator_mode)
File "/home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/bpod/bpod_com_protocol.py", line 34, in __init__
super(BpodCOMProtocol, self).__init__(serial_port, sync_channel, sync_mode, emulator_mode=emulator_mode)
File "/home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/bpod/bpod_base.py", line 75, in __init__
self.__initialize_input_command_handler()
File "/home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/bpod/bpod_base.py", line 505, in __initialize_input_command_handler
self.sock.bind(('0.0.0.0', self.net_port))
OSError: [Errno 98] Address already in use
Unhandled Python exception
Aborted (core dumped)
^^ The virtual mouse works,but once you try to end the trial it freezes pybpod. I then close the program and restart. Opening back up again I get this error:
An error occurred when trying to load the info for session [20230629-105105]. Traceback (most recent call last): File "/home/henry/Documents/chris-pybpod/base/pybpod-gui-plugin/pybpodgui_plugin/models/session/session_window.py", line 64, in load Session.load(self, path) File "/home/henry/Documents/chris-pybpod/base/pybpod-gui-api/pybpodgui_api/models/session/session_io.py", line 92, in load csvreader = self.load_info() File "/home/henry/Documents/chris-pybpod/base/pybpod-gui-api/pybpodgui_api/models/session/session_io.py", line 141, in load_info for row in csvreader: File "/home/henry/Documents/chris-pybpod/libraries/safe-collaborative-architecture/sca/formats/csv.py", line 106, in __next__ self._read_metadata = self.__checkfor_flags(row) File "/home/henry/Documents/chris-pybpod/libraries/safe-collaborative-architecture/sca/formats/csv.py", line 112, in __checkfor_flags if len(row)==0: return False TypeError: object of type 'NoneType' has no len()
I also just got another error, after this one:
They both existed as their own pop out window
Every time I open pybpod I can error similar to this. Multiple pop up. I have deleted the sessions which are in the error but that doesn't make them stop
something is up with the project folder I was using. Changing to a different project with the mouse2afc protocol, everything works as it is suppose to. Some how using the virtual mouse as nuked the use of the project folder I have been using up until this point
While messing around with the trend-2afc-plugin, I have caused this error which I cannot fix by reverting the changing I made to the code nor restarting vscode
Exception has occurred: EmulatorError
Could not connect to server: QLocalSocket::connectToServer: Connection refused
File "/home/henry/Documents/pybpod-api/pybpodapi/bpod/emulator/emulator.py", line 254, in _send_output_to_gui_server
raise EmulatorError(error_message)
File "/home/henry/Documents/pybpod-api/pybpodapi/bpod/emulator/emulator.py", line 443, in mirror_state
new_output_channel, new_output_value)
File "/home/henry/Documents/pybpod-api/pybpodapi/bpod/bpod_base.py", line 627, in __process_opcode
self._emulator.mirror_state(sma.current_state)
File "/home/henry/Documents/pybpod-api/pybpodapi/bpod/bpod_base.py", line 331, in run_state_machine
sma, opcode, data, state_change_indexes):
File "/home/henry/Documents/mouse2afc/mouse2afc.py", line 45, in run
if not self._bpod.run_state_machine(sma):
File "/home/henry/Documents/mouse2afc/emulator_run_manual_override", line 11, in main
Mouse2AFC(bpod).run()
File "/home/henry/Documents/mouse2afc/emulator_run_manual_override", line 15, in <module>
main()
pybpodapi.bpod.emulator.emulator.EmulatorError: Could not connect to server: QLocalSocket::connectToServer: Connection refused
^^ I had to restart my computer
EDIT: I think this error has something to do with using the physical bpod rig and firmware.
Now I get this:
An error in the trend plugin occurred. Check logs for details.
looking in terminal:
[] [] []
/home/henry/Documents/chris-pybpod/plugins/trend-2fc-plugin/trend_2fc_session_plugin/session_trend.py:354: UserWarning: FixedFormatter should only be used together with FixedLocator
axes1.set_yticklabels(['R', 'L'])
File "/home/henry/Documents/chris-pybpod/plugins/trend-2fc-plugin/trend_2fc_session_plugin/exc_manager.py", line 19, in wrapper
return func(self, *args, **kwargs)
File "/home/henry/Documents/chris-pybpod/plugins/trend-2fc-plugin/trend_2fc_session_plugin/session_trend.py", line 95, in __init__
self._setup_name = dataframe[dataframe.MSG == 'SETUP-NAME']['+INFO'].iloc[0]
Traceback (most recent call last):
File "/home/henry/Documents/chris-pybpod/plugins/trend-2fc-plugin/trend_2fc_session_plugin/exc_manager.py", line 19, in wrapper
return func(self, *args, **kwargs)
File "/home/henry/Documents/chris-pybpod/plugins/trend-2fc-plugin/trend_2fc_session_plugin/session_trend.py", line 95, in __init__
self._setup_name = dataframe[dataframe.MSG == 'SETUP-NAME']['+INFO'].iloc[0]
AttributeError: 'NoneType' object has no attribute 'MSG'
File "/home/henry/Documents/chris-pybpod/plugins/trend-2fc-plugin/trend_2fc_session_plugin/session_trend.py", line 157, in read_message_queue
self.reward_side = self.session.data[self.session.data.MSG == "REWARD_SIDE"]['+INFO'].iloc[-1]
While messing around with this plugin, I have caused this error which I cannot fix by reverting the changing I made to the code nor restarting vscode
Exception has occurred: EmulatorError Could not connect to server: QLocalSocket::connectToServer: Connection refused File "/home/henry/Documents/pybpod-api/pybpodapi/bpod/emulator/emulator.py", line 254, in _send_output_to_gui_server raise EmulatorError(error_message) File "/home/henry/Documents/pybpod-api/pybpodapi/bpod/emulator/emulator.py", line 443, in mirror_state new_output_channel, new_output_value) File "/home/henry/Documents/pybpod-api/pybpodapi/bpod/bpod_base.py", line 627, in __process_opcode self._emulator.mirror_state(sma.current_state) File "/home/henry/Documents/pybpod-api/pybpodapi/bpod/bpod_base.py", line 331, in run_state_machine sma, opcode, data, state_change_indexes): File "/home/henry/Documents/mouse2afc/mouse2afc.py", line 45, in run if not self._bpod.run_state_machine(sma): File "/home/henry/Documents/mouse2afc/emulator_run_manual_override", line 11, in main Mouse2AFC(bpod).run() File "/home/henry/Documents/mouse2afc/emulator_run_manual_override", line 15, in <module> main() pybpodapi.bpod.emulator.emulator.EmulatorError: Could not connect to server: QLocalSocket::connectToServer: Connection refused
Vscode was working fine. I then moved to pybpod to try out the changes. Got the error in the pervious comment https://github.com/HenryJFlynn/mouse2afc/issues/30#issuecomment-1613048810 and now in vscode I get the error I am quote replying
For this error:
self.session.data.MSG is a none type. self is an object of the SessionTrend
class. SessionTrend is called in session_treenode.py
with self.sessiontrend_win = SessionTrend(self)
where self is an object of the SessionTreeNode
Class. This class overwrites the default pybpod SessionTreeNode
. See the wiki
It is possible that the trend 2fc plugin is outdated. Using the example they provided (i did make emulator_mode=true), I get An error in the trend plugin occurred. Check logs for details
which tells me that it isn't anything that I am doing wrong. If their example doesn't work, how is mine going to?
One potential error I am making is that I can follow all their steps until step 8 Select Tools and open the plugin
. Where is Tools
?
Also window the plugin creates on the website(or the README.md) is slightly different than the one I get when i open pybpod
Trying the timeline plugin
^^ If click the update button in the timeline plugin popup window, in terminal i get this error:
Traceback (most recent call last):
File "/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-timeline/pybpodgui_plugin_timeline/trials_plot_window.py", line 81, in __refresh_evt
self._events.clear()
AttributeError: 'ControlEventsGraph' object has no attribute 'clear'
chasing it down: from pyforms.controls import ControlEventsGraph
-> controls.py
->
if conf.PYFORMS_MODE in ['GUI']:
from pyforms_gui.allcontrols import *
--> allcontols.py
which is a use file which imports a bunch of things an has try except statements. This file is what creates the error:
ControlWeb will not work
QtWebEngine may be missing
which is in terminal every time I use pybpod. One of the imports in allcontrols.py
is
from.controls.control_events_graph.control_eventsgraph import ControlEventsGraph
going to control_eventsgraph.py
we do not see a clear function like the error indicates though there is a clear function in Track.py
which is in the same folder
The purpose of this issue changed, accordingly I have hidden comments which were outdated/irrelevant to the new purpose.
I am now revisiting this issue and will be going through the plugins again
Plugins add functionalities to pybpod, some of which are vital to our experimentation. Pybpod and the community have created plugins to do varies things, see the list here. The plugins of interest are:
Many plugins which we want have been created by the de la Rocha lab, here is their bit bucket. I believe there is a lot to be learned from looking at what these people have done with pybpod