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

Facilitate pybpod GUI for running protocol #7

Closed
5 of 6 tasks
ckarageorgkaneen opened this issue May 17, 2023 · 52 comments
Closed
5 of 6 tasks

Facilitate pybpod GUI for running protocol #7

ckarageorgkaneen opened this issue May 17, 2023 · 52 comments
Assignees
Labels
enhancement New feature or request

Comments

@ckarageorgkaneen
Copy link
Collaborator

ckarageorgkaneen commented May 17, 2023

TODO:

  • git clone --recursive https://github.com/ckarageorgkaneen/pybpod.git chris-pybpod
  • Get emulator plugin up and running
  • Test it out on an example protocol in emulator mode, verify it works as expected
  • Integrate our mouse2afc protocol in the plugin, so we can select it
  • Run our protocol, simulate real mouse pokes and verify it works as expected
  • Mess with settings to see if each state, input and output work properly
@ckarageorgkaneen ckarageorgkaneen converted this from a draft issue May 17, 2023
@ckarageorgkaneen ckarageorgkaneen added the enhancement New feature or request label May 25, 2023
@ckarageorgkaneen ckarageorgkaneen moved this from Todo to In Progress in Mouse2AFC Protocol May 25, 2023
@HenryJFlynn
Copy link
Owner

Trying to clone repo and sub modules doesn't work

henry@henry-Vostro-270:~/Documents$ git clone --recursive https://github.com/ckarageorgkaneen/pybpod.git  chris-pybpod
Cloning into 'chris-pybpod'...
remote: Enumerating objects: 1273, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 1273 (delta 5), reused 7 (delta 2), pack-reused 1261
Receiving objects: 100% (1273/1273), 8.85 MiB | 834.00 KiB/s, done.
Resolving deltas: 100% (733/733), done.
Submodule 'base - pybpod-api' (ssh://[email protected]/ckarageorgkaneen/pybpod-api.git) registered for path 'base/pybpod-api'
Submodule 'base - pybpod-gui-api' (https://github.com/pybpod/pybpod-gui-api.git) registered for path 'base/pybpod-gui-api'
Submodule 'base - pybpod-gui-plugin' (ssh://[email protected]/ckarageorgkaneen/pybpod-gui-plugin.git) registered for path 'base/pybpod-gui-plugin'
Submodule 'libs - logging-bootstrap' (https://bitbucket.org/fchampalimaud/logging-bootstrap.git) registered for path 'libraries/logging-bootstrap'
Submodule 'libs - pyforms-generic-editor' (https://bitbucket.org/fchampalimaud/pyforms-generic-editor.git) registered for path 'libraries/pyforms-generic-editor'
Submodule 'libs - pyforms-gui' (https://github.com/UmSenhorQualquer/pyforms-gui.git) registered for path 'libraries/pyforms-gui'
Submodule 'libs - safe-collaborative-architecture' (https://bitbucket.org/fchampalimaud/safe-collaborative-architecture.git) registered for path 'libraries/safe-collaborative-architecture'
Submodule 'plugins - pge-terminal' (https://bitbucket.org/fchampalimaud/pge-plugin-terminal.git) registered for path 'plugins/pge-plugin-terminal'
Submodule 'plugins - pybpod-gui-plugin-alyx' (https://github.com/pybpod/pybpod-gui-plugin-alyx) registered for path 'plugins/pybpod-gui-plugin-alyx'
Submodule 'plugins - pybpod-gui-plugin-emulator' (ssh://[email protected]/ckarageorgkaneen/pybpod-gui-plugin-emulator.git) registered for path 'plugins/pybpod-gui-plugin-emulator'
Submodule 'plugins - pybpod-gui-plugin-rotaryencoder' (https://github.com/pybpod/pybpod-gui-plugin-rotaryencoder.git) registered for path 'plugins/pybpod-gui-plugin-rotaryencoder'
Submodule 'plugins - pybpod-gui-plugin-session-history' (https://github.com/pybpod/pybpod-gui-plugin-session-history.git) registered for path 'plugins/pybpod-gui-plugin-session-history'
Submodule 'plugins - pybpod-gui-plugin-soundcard' (https://github.com/pybpod/pybpod-gui-plugin-soundcard.git) registered for path 'plugins/pybpod-gui-plugin-soundcard'
Submodule 'plugins - pybpod-gui-plugin-stmdiagram' (https://github.com/pybpod/pybpod-gui-plugin-stmdiagram.git) registered for path 'plugins/pybpod-gui-plugin-stmdiagram'
Submodule 'plugins - pybpod-gui-plugin-timeline' (https://github.com/pybpod/pybpod-gui-plugin-timeline.git) registered for path 'plugins/pybpod-gui-plugin-timeline'
Submodule 'plugins - pybpod-gui-plugin-trial-timeline' (https://github.com/pybpod/pybpod-gui-plugin-trial-timeline) registered for path 'plugins/pybpod-gui-plugin-trial-timeline'
Submodule 'plugins - pybpod-gui-plugin-waveplayer' (https://github.com/pybpod/pybpod-gui-plugin-waveplayer) registered for path 'plugins/pybpod-gui-plugin-waveplayer'
Cloning into '/home/henry/Documents/chris-pybpod/base/pybpod-api'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'ssh://[email protected]/ckarageorgkaneen/pybpod-api.git' into submodule path '/home/henry/Documents/chris-pybpod/base/pybpod-api' failed
Failed to clone 'base/pybpod-api'. Retry scheduled
Cloning into '/home/henry/Documents/chris-pybpod/base/pybpod-gui-api'...
remote: Enumerating objects: 1566, done.        
remote: Counting objects: 100% (16/16), done.        
remote: Compressing objects: 100% (13/13), done.        
remote: Total 1566 (delta 5), reused 9 (delta 3), pack-reused 1550        
Receiving objects: 100% (1566/1566), 250.80 KiB | 1.57 MiB/s, done.
Resolving deltas: 100% (1077/1077), done.
Cloning into '/home/henry/Documents/chris-pybpod/base/pybpod-gui-plugin'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'ssh://[email protected]/ckarageorgkaneen/pybpod-gui-plugin.git' into submodule path '/home/henry/Documents/chris-pybpod/base/pybpod-gui-plugin' failed
Failed to clone 'base/pybpod-gui-plugin'. Retry scheduled
Cloning into '/home/henry/Documents/chris-pybpod/libraries/logging-bootstrap'...
Cloning into '/home/henry/Documents/chris-pybpod/libraries/pyforms-generic-editor'...
Receiving objects: 100% (1060/1060), 690.53 KiB | 1.70 MiB/s, done.
Resolving deltas: 100% (578/578), done.
Cloning into '/home/henry/Documents/chris-pybpod/libraries/pyforms-gui'...
remote: Enumerating objects: 1426, done.        
remote: Counting objects: 100% (66/66), done.        
remote: Compressing objects: 100% (23/23), done.        
remote: Total 1426 (delta 26), reused 62 (delta 25), pack-reused 1360        
Receiving objects: 100% (1426/1426), 3.53 MiB | 1.52 MiB/s, done.
Resolving deltas: 100% (928/928), done.
Cloning into '/home/henry/Documents/chris-pybpod/libraries/safe-collaborative-architecture'...
Receiving objects: 100% (120/120), 19.26 KiB | 6.42 MiB/s, done.
Resolving deltas: 100% (51/51), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pge-plugin-terminal'...
Receiving objects: 100% (125/125), 102.58 KiB | 729.00 KiB/s, done.
Resolving deltas: 100% (56/56), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-alyx'...
remote: Enumerating objects: 410, done.        
remote: Counting objects: 100% (17/17), done.        
remote: Compressing objects: 100% (13/13), done.        
remote: Total 410 (delta 6), reused 10 (delta 4), pack-reused 393        
Receiving objects: 100% (410/410), 59.34 KiB | 1.21 MiB/s, done.
Resolving deltas: 100% (242/242), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-emulator'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'ssh://[email protected]/ckarageorgkaneen/pybpod-gui-plugin-emulator.git' into submodule path '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-emulator' failed
Failed to clone 'plugins/pybpod-gui-plugin-emulator'. Retry scheduled
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-rotaryencoder'...
remote: Enumerating objects: 350, done.        
remote: Total 350 (delta 0), reused 0 (delta 0), pack-reused 350        
Receiving objects: 100% (350/350), 349.81 KiB | 1.71 MiB/s, done.
Resolving deltas: 100% (216/216), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-session-history'...
remote: Enumerating objects: 212, done.        
remote: Total 212 (delta 0), reused 0 (delta 0), pack-reused 212        
Receiving objects: 100% (212/212), 28.49 KiB | 595.00 KiB/s, done.
Resolving deltas: 100% (122/122), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-soundcard'...
remote: Enumerating objects: 421, done.        
remote: Total 421 (delta 0), reused 0 (delta 0), pack-reused 421        
Receiving objects: 100% (421/421), 297.95 KiB | 510.00 KiB/s, done.
Resolving deltas: 100% (281/281), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-stmdiagram'...
remote: Enumerating objects: 59, done.        
remote: Total 59 (delta 0), reused 0 (delta 0), pack-reused 59        
Receiving objects: 100% (59/59), 13.61 KiB | 302.00 KiB/s, done.
Resolving deltas: 100% (17/17), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-timeline'...
remote: Enumerating objects: 137, done.        
remote: Total 137 (delta 0), reused 0 (delta 0), pack-reused 137        
Receiving objects: 100% (137/137), 18.85 KiB | 371.00 KiB/s, done.
Resolving deltas: 100% (71/71), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-trial-timeline'...
remote: Enumerating objects: 104, done.        
remote: Total 104 (delta 0), reused 0 (delta 0), pack-reused 104        
Receiving objects: 100% (104/104), 20.33 KiB | 416.00 KiB/s, done.
Resolving deltas: 100% (43/43), done.
Cloning into '/home/henry/Documents/chris-pybpod/plugins/pybpod-gui-plugin-waveplayer'...
remote: Enumerating objects: 121, done.        
remote: Total 121 (delta 0), reused 0 (delta 0), pack-reused 121        
Receiving objects: 100% (121/121), 37.63 KiB | 786.00 KiB/s, done.
Resolving deltas: 100% (48/48), done.
Cloning into '/home/henry/Documents/chris-pybpod/base/pybpod-api'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'ssh://[email protected]/ckarageorgkaneen/pybpod-api.git' into submodule path '/home/henry/Documents/chris-pybpod/base/pybpod-api' failed
Failed to clone 'base/pybpod-api' a second time, aborting

@HenryJFlynn
Copy link
Owner

desktop/desktop#2344

@HenryJFlynn
Copy link
Owner

The sub modules could only be clonedwith ssh permission see pybpod/pybpod@98c03e6

@ckarageorgkaneen
Copy link
Collaborator Author

ckarageorgkaneen commented May 25, 2023

My bad. Fixed by amending pybpod/pybpod@98c03e6.

@ckarageorgkaneen
Copy link
Collaborator Author

For start-pybpod, see pybpod/pybpod#91.

@HenryJFlynn
Copy link
Owner

Must update pip in the environment for any pip install ... to work properly

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 26, 2023

trying to get the pybod gui ti successfully run the examples protocol 10_state_example

When my_bpod = Bpod(emulator_mode=...) is
True nothing happens. Hit start, it runs for a few seconds then the gui resets. No output. No error. No nothing
False or gibberish or gbf or instantly runs and resets. no output. no error.
nothing, so Bpod() nothing happens

With clear errors in the protocol such as deleting half of the protocol, there is no error. In some of my proding i got it to pop this error but i haven't been able to reproduce it.

Traceback (most recent call last):
  File "/home/henry/Documents/pybpod-testing/Untitled project 7/tasks/10_state_example/10_state_example.py", line 2, in <module>
    my_bpod = Bpod(emulator_mode = dg98)
NameError: name 'dg98' is not defined
Traceback (most recent call last):
  File "/home/henry/Documents/pybpod-testing/Untitled project 7/tasks/10_state_example/10_state_example.py", line 3, in <module>
    sma = StateMachine(my_bpod)
  File "/home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/state_machine/state_machine_runner.py", line 20, in __init__
    StateMachineBuilder.__init__(self, bpod)
  File "/home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/state_machine/state_machine_base.py", line 52, in __init__
    self.state_timers = [0] * self.hardware.max_states  # list(float)
TypeError: can't multiply sequence by non-int of type 'NoneType'

This is with emulator mode enabled in the gui. Without, the protocol IO fails to open and crashes the program.

@HenryJFlynn
Copy link
Owner

when i first start the program

(pybpod-environment) henry@henry-Vostro-270:~/Documents/chris-pybpod/base/pybpod$ start-pybpod
/lib/x86_64-linux-gnu/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var
ControlWeb will not work
QtWebEngine may be missing
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
libpng warning: iCCP: known incorrect sRGB profile
26/05/2023 02:44:40 | WARNING | 8756 | pyforms_generic_editor.plugins.loader | install_plugins | Plugins path was not defined by user
libGL error: MESA-LOADER: failed to open crocus: /usr/lib/dri/crocus_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: crocus
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

@HenryJFlynn
Copy link
Owner

after trying: helloSystem/LinuxRuntime#11

ERROR: ld.so: object '/usr/lib64/libfreetype.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib64/libfreetype.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
/lib/x86_64-linux-gnu/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var
ControlWeb will not work
QtWebEngine may be missing
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
libpng warning: iCCP: known incorrect sRGB profile
26/05/2023 03:46:40 | WARNING | 11250 | pyforms_generic_editor.plugins.loader | install_plugins | Plugins path was not defined by user
libGL error: MESA-LOADER: failed to open crocus: /usr/lib/dri/crocus_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: crocus
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

@HenryJFlynn
Copy link
Owner

just gonna ignore that error ^.

Current problems:

  • Can run protocols but ones which require inputs such as poking in do not prompt the user. The protocol IO does not light up any behavior ports.

  • Do not know how to change user_settings

@HenryJFlynn
Copy link
Owner

also sometimes this happens
image
the task editor is blank. There should be code there

@HenryJFlynn
Copy link
Owner

just got the error e ignored in the board log. idk what is going on

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 29, 2023

Steps start up and pybpod

  1. open pybpod folder inside terminal
  2. start-pybpod
  3. File --> Open Project --> select your project
  4. Go to boards --> Select Board --> select Emulator mode + click Console
  5. Go to Users --> Double click on desired user for this experiment
  6. Go to Project ->Experiment->ExperimentName->SetupName select board, protocol, and add subjects
  7. Click Test Protocol IO button
  8. run the protocol

@HenryJFlynn
Copy link
Owner

gui plugin must be at the end

image

@HenryJFlynn
Copy link
Owner

after changing user settings, protocols opened in the task editor are empty. Blank. There is no code.

@ckarageorgkaneen
Copy link
Collaborator Author

after changing user settings, protocols opened in the task editor are empty. Blank. There is no code.

If you revert the changes, does the code re-appear?

@HenryJFlynn
Copy link
Owner

going from ~/Documents/chris-pybpod/base/pybpod$ user_settings.py is created in Home, outside of Documents.

@HenryJFlynn
Copy link
Owner

pybpod gets its firmware and version from the api settings file. There is no way to easily change them as a user. To do this, we would like to add a snippet of code in board_com.py which takes the firmware and version type from a user_settings files which we specifiy

@HenryJFlynn
Copy link
Owner

another problem is that running the protocol light_chasing_examples... doesn't work properly. It requires a poke input which it never receives yet it runs.

@HenryJFlynn
Copy link
Owner

another problem is that running the protocol light_chasing_examples... doesn't work properly. It requires a poke input which it never receives yet it runs.

Once the proper firmware and version with correct number of ports are implemented in the gui, this protocol runs fine

@ckarageorgkaneen
Copy link
Collaborator Author

another problem is that running the protocol light_chasing_examples... doesn't work properly. It requires a poke input which it never receives yet it runs.

Once the proper firmware and version with correct number of ports are implemented in the gui, this protocol runs fine

awesome

@HenryJFlynn
Copy link
Owner

pybpod gets its firmware and version from the api settings file. There is no way to easily change them as a user. To do this, we would like to add a snippet of code in board_com.py which takes the firmware and version type from a user_settings files which we specifiy

I was wrong. We don't need to do this. Copy and pasting the desired settings into the user settings you can set in the gui works fine.

My setting look like this

SETTINGS_PRIORITY = 0

GENERIC_EDITOR_PLUGINS_LIST = ['pybpodgui_plugin', 'pybpod_gui_plugin_emulator']

TARGET_BPOD_FIRMWARE_VERSION = "8"
EMULATOR_BPOD_MACHINE_TYPE = 1

BPOD_BNC_PORTS_ENABLED = [True, True]
BPOD_WIRED_PORTS_ENABLED = [True, True, True, True]
BPOD_BEHAVIOR_PORTS_ENABLED = [True, True, True, False, False, False, False, False]

and I get this this

image

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 29, 2023

problems with with the gui

  1. if you poke in or out too fast, it crashes
  2. if emulator mode isn't enables, it crashes
  3. if buttons are checked when the protocol ends, they remain checked.
  4. if you press Run Protocol and you can't run because you didn't save for examples, the button doesn't reset. It still looks pressed

@HenryJFlynn
Copy link
Owner

all the examples run fine except emulator_10_state_w_pwm_outputs_examples due to firmware requirements. I am looking past this as it is irrelevant and moving on to mouse2afc.

running emulator_mouse2afc_example, this is my complete output:

['__UUID4__', '8b305563-5c36-420b-9d10-4f4000850049']
['__CREATED-ON__', '2023-05-29 12:50:51.205583']
['__DEF-URL__', 'http://pybpod-api.readthedocs.org']
['__DEF-TEXT__', 'This file contains data recorded during a session from the PyBpod system']
['__SOFTWARE__', 'PyBpod API v1.8.2']
['__HAS-HEADER__']
['TYPE', 'PC-TIME', 'BPOD-INITIAL-TIME', 'BPOD-FINAL-TIME', 'MSG', '+INFO']
['INFO', '2023-05-29 12:50:51.206482', '', '', 'SERIAL-PORT', '']
['INFO', '2023-05-29 12:50:51.206549', '', '', 'PROTOCOL-NAME', 'emulator_mouse2afc_example']
['INFO', '2023-05-29 12:50:51.206575', '', '', 'CREATOR-NAME', '["csk", "9c98433a-110b-47a7-a0c8-80572324d10e", "local"]']
['INFO', '2023-05-29 12:50:51.206598', '', '', 'PROJECT-NAME', 'pybpod-project']
['INFO', '2023-05-29 12:50:51.206619', '', '', 'EXPERIMENT-NAME', 'Experiment_1']
['INFO', '2023-05-29 12:50:51.206640', '', '', 'BOARD-NAME', 'Board_1']
['INFO', '2023-05-29 12:50:51.206661', '', '', 'SETUP-NAME', 'Setup_1']
['INFO', '2023-05-29 12:50:51.206683', '', '', 'BPOD-GUI-VERSION', '']
['INFO', '2023-05-29 12:50:51.206702', '', '', 'NET-PORT', '36000']
['INFO', '2023-05-29 12:50:51.206725', '', '', 'SUBJECT-NAME', "['Mickey', 'f2ab9be6-1b0f-4c52-b78f-567f7dd06006']"]
['INFO', '2023-05-29 12:50:51.206761', '', '', 'This is a PYBPOD file. Find more info at http://pybpod.readthedocs.io', '']
['INFO', '2023-05-29 12:50:51.206784', '', '', 'BPOD-API-VERSION', '1.8.2']
['INFO', '2023-05-29 12:50:51.206803', '', '', 'SESSION-NAME', '20230529-125050']
['INFO', '2023-05-29 12:50:51.206822', '', '', 'SESSION-STARTED', '2023-05-29 12:50:51.205421']

b'Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.\n'
b'libGL error: MESA-LOADER: failed to open crocus: /usr/lib/dri/crocus_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n'
b'libGL error: failed to load driver: crocus\n'
b'libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n'
b'libGL error: failed to load driver: swrast\n'
['stderr', '2023-05-29 12:50:54.117685', '', 'Before StateMatrix()', '', '']
['stderr', '2023-05-29 12:50:54.117934', '', '\n', '', '']
['stderr', '2023-05-29 12:50:54.119799', '', 'Traceback (most recent call last):\n', '', '']
['stderr', '2023-05-29 12:50:54.119942', '', '  File "/home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/state_machine/state_machine_base.py", line 221, in add_state\n', '', '']
['stderr', '2023-05-29 12:50:54.120295', '', '    ', '', '']
['stderr', '2023-05-29 12:50:54.120343', '', 'action_name', '', '']
['stderr', '2023-05-29 12:50:54.120378', '', '\n', '', '']
['stderr', '2023-05-29 12:50:54.120418', '', 'ValueError', '', '']
['stderr', '2023-05-29 12:50:54.120452', '', ': ', '', '']
['stderr', '2023-05-29 12:50:54.120483', '', "'Wire1' is not in list", '', '']
['stderr', '2023-05-29 12:50:54.120516', '', '\n', '', '']
['stderr', '2023-05-29 12:50:54.120546', '', '\nDuring handling of the above exception, another exception occurred:\n\n', '', '']
['stderr', '2023-05-29 12:50:54.120581', '', 'Traceback (most recent call last):\n', '', '']
['stderr', '2023-05-29 12:50:54.120616', '', '  File "/home/henry/Documents/pybpod-project/tasks/emulator_mouse2afc_example/emulator_mouse2afc_example.py", line 8, in <module>\n', '', '']
['stderr', '2023-05-29 12:50:54.120752', '', '    ', '', '']
['stderr', '2023-05-29 12:50:54.120791', '', 'Mouse2AFC(bpod).run()', '', '']
['stderr', '2023-05-29 12:50:54.120823', '', '\n', '', '']
['stderr', '2023-05-29 12:50:54.120855', '', '  File "/home/henry/Documents/mouse2afc/mouse2afc.py", line 99, in run\n', '', '']
['stderr', '2023-05-29 12:50:54.120998', '', '    ', '', '']
['stderr', '2023-05-29 12:50:54.121036', '', 'self._bpod, self._task_parameters, self._data, i_trial)', '', '']
['stderr', '2023-05-29 12:50:54.121070', '', '\n', '', '']
['stderr', '2023-05-29 12:50:54.121102', '', '  File "/home/henry/Documents/mouse2afc/state_matrix.py", line 537, in __init__\n', '', '']
['stderr', '2023-05-29 12:50:54.121381', '', '    ', '', '']
['stderr', '2023-05-29 12:50:54.121420', '', 'output_actions=(IncorrectChoice_Signal + WaitFeedbackStim))', '', '']
['stderr', '2023-05-29 12:50:54.121453', '', '\n', '', '']
['stderr', '2023-05-29 12:50:54.121485', '', '  File "/home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/state_machine/state_machine_base.py", line 229, in add_state\n', '', '']
['stderr', '2023-05-29 12:50:54.121670', '', '    ', '', '']
['stderr', '2023-05-29 12:50:54.121708', '', '+ " is an invalid output name."', '', '']
['stderr', '2023-05-29 12:50:54.121740', '', '\n', '', '']
['stderr', '2023-05-29 12:50:54.121775', '', 'pybpodapi.state_machine.state_machine_base', '', '']
['stderr', '2023-05-29 12:50:54.121808', '', '.', '', '']
['stderr', '2023-05-29 12:50:54.121839', '', 'SMAError', '', '']
['stderr', '2023-05-29 12:50:54.121871', '', ': ', '', '']
['stderr', '2023-05-29 12:50:54.121901', '', 'Error creating state: Punishment. Wire1 is an invalid output name.', '', '']
['stderr', '2023-05-29 12:50:54.121934', '', '\n', '', '']

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 29, 2023

Found another work around for ^^. In the task parameter gui, don't select BeepOnWire_1

Similarly, this error can happens with the state WaitForPunishStart due to its output of Wire1OutError :

# Wire1 settings
        Wire1OutError = iff(task_parameters.Wire1VideoTrigger, [(
                            'Wire2', 2)], [])
        Wire1OutCorrectCondition = task_parameters.Wire1VideoTrigger and \
            data.Custom.CatchTrial[i_trial]
        Wire1OutCorrect = iff(Wire1OutCorrectCondition,
                              [('Wire2', 2)], [])

If these two options are not selected to avoid ('WireX','Y') as an output, the protocol runs fun. There issue is with the wire outputs

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 29, 2023

pybpod gets its firmware and version from the api settings file. There is no way to easily change them as a user. To do this, we would like to add a snippet of code in board_com.py which takes the firmware and version type from a user_settings files which we specifiy

I was wrong. We don't need to do this. Copy and pasting the desired settings into the user settings you can set in the gui works fine.

My setting look like this

SETTINGS_PRIORITY = 0

GENERIC_EDITOR_PLUGINS_LIST = ['pybpodgui_plugin', 'pybpod_gui_plugin_emulator']

TARGET_BPOD_FIRMWARE_VERSION = "8"
EMULATOR_BPOD_MACHINE_TYPE = 1

BPOD_BNC_PORTS_ENABLED = [True, True]
BPOD_WIRED_PORTS_ENABLED = [True, True, True, True]
BPOD_BEHAVIOR_PORTS_ENABLED = [True, True, True, False, False, False, False, False]

and I get this this

image

I was wrong about being wrong. I got the protocol to run without Wire1 is an invalid output name by 1. Changing the api settings files firmware and machine type and 2. Keeping

> BPOD_BNC_PORTS_ENABLED = [True, True]
> BPOD_WIRED_PORTS_ENABLED = [True, True, True, True]
> BPOD_BEHAVIOR_PORTS_ENABLED = [True, True, True, False, False, False, False, False]

in user settings. For some reason without it, pybpod crashes. Specifcally the file inside /home/henry/Documents/chris-pybpod/base/pybpod-api/pybpodapi/settings.py

@HenryJFlynn
Copy link
Owner

I do not understand why it works or doesn't work.

@HenryJFlynn
Copy link
Owner

I would like to do the first idea of inputting a line or two to check for user settings which would then overwrite the current settings as to add the current firmware and number of ports etc. My problem is finding where the program gets its settings to begin with

@HenryJFlynn
Copy link
Owner

in board_com.py

# load bpod configuration template
        template = os.path.join(os.path.dirname(__file__), 'run_settings_template.py')
        bpod_settings = open(template, 'r').read().format(
            serialport=board.serial_port,
            bnp_ports=('BPOD_BNC_PORTS_ENABLED = {0}'.format(board.enabled_bncports) if board.enabled_bncports else ''),
            wired_ports=('BPOD_WIRED_PORTS_ENABLED = {0}'.format(board.enabled_wiredports) if board.enabled_wiredports else ''),
            behavior_ports=('BPOD_BEHAVIOR_PORTS_ENABLED = {0}'.format(board.enabled_behaviorports) if board.enabled_behaviorports else ''),
            session_name=session.name,
            netport=board_task.board.net_port,
            stream2stdout=not detached,
            project=session.project.name,
            experiment=session.setup.experiment.name,
            board=board_task.board.name,
            setup=session.setup.name,
            session=session.name,
            protocolname=board_task.task.name,
            session_path=os.path.abspath(session.path).encode('unicode_escape').decode(),
            subjects=','.join(list(map(lambda x: '"'+str(x)+'"', session.subjects))),
            user=json.dumps([session.user.name, str(session.user.uuid4), session.user.connection] if session.user.uuid4 else None),
            subject_extra=','.join(list(map(lambda x: '"'+str(x)+'"', xt_subject))),
            user_extra=xt_user,
            variables_names=','.join(["'"+var.name+"'" for var in board_task.variables]),
            bpod_firmware_version=conf.TARGET_BPOD_FIRMWARE_VERSION
        )

The bpod_firmware_version=conf.TARGET_BPOD_FIRMWARE_VERSION is read from the gui user settings

@ckarageorgkaneen
Copy link
Collaborator Author

in board_com.py

# load bpod configuration template
        template = os.path.join(os.path.dirname(__file__), 'run_settings_template.py')
        bpod_settings = open(template, 'r').read().format(
            serialport=board.serial_port,
            bnp_ports=('BPOD_BNC_PORTS_ENABLED = {0}'.format(board.enabled_bncports) if board.enabled_bncports else ''),
            wired_ports=('BPOD_WIRED_PORTS_ENABLED = {0}'.format(board.enabled_wiredports) if board.enabled_wiredports else ''),
            behavior_ports=('BPOD_BEHAVIOR_PORTS_ENABLED = {0}'.format(board.enabled_behaviorports) if board.enabled_behaviorports else ''),
            session_name=session.name,
            netport=board_task.board.net_port,
            stream2stdout=not detached,
            project=session.project.name,
            experiment=session.setup.experiment.name,
            board=board_task.board.name,
            setup=session.setup.name,
            session=session.name,
            protocolname=board_task.task.name,
            session_path=os.path.abspath(session.path).encode('unicode_escape').decode(),
            subjects=','.join(list(map(lambda x: '"'+str(x)+'"', session.subjects))),
            user=json.dumps([session.user.name, str(session.user.uuid4), session.user.connection] if session.user.uuid4 else None),
            subject_extra=','.join(list(map(lambda x: '"'+str(x)+'"', xt_subject))),
            user_extra=xt_user,
            variables_names=','.join(["'"+var.name+"'" for var in board_task.variables]),
            bpod_firmware_version=conf.TARGET_BPOD_FIRMWARE_VERSION
        )

The bpod_firmware_version=conf.TARGET_BPOD_FIRMWARE_VERSION is read from the gui user settings

Put more custom settings in the GUI user settings. Then put a breakpoint after this statement and run a protocol. When the breakpoint is reached, print the contents of conf. If all the custom settings that you added are in there, then they are in fact picked up.

@HenryJFlynn
Copy link
Owner

See HenryJFlynn/pybpod-gui-api#1 for the fix to Error creating state: Punishment. Wire1 is an invalid output name

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 31, 2023

Currently the pybpod task parameters settings are so that there is little to no time to make a choice. You centerpoke and before you can pokeout the trial is over. Gonna try to fix this by updating the config.py to reflect the settings in the matlab gui.

@HenryJFlynn
Copy link
Owner

Differences between matlab task parameter gui and pybpod

  1. pybpod has no settings for a second experiment
  2. location of certain values
  3. pybpod has no isOptoTrial visible in gui

@HenryJFlynn
Copy link
Owner

Currently the pybpod task parameters settings are so that there is little to no time to make a choice. You centerpoke and before you can pokeout the trial is over. Gonna try to fix this by updating the config.py to reflect the settings in the matlab gui.

This didn't help and made things worse

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 31, 2023

['stderr', '2023-05-31 11:43:40.798847', '', 'Before StateMatrix()', '', '']
['stderr', '2023-05-31 11:43:40.798933', '', '\n', '', '']
['stderr', '2023-05-31 11:43:40.800174', '', 'Before send_state_machine()', '', '']
['stderr', '2023-05-31 11:43:40.800325', '', '\n', '', '']
['stderr', '2023-05-31 11:43:40.805836', '', 'Before run_state_machine()', '', '']
['stderr', '2023-05-31 11:43:40.805992', '', '\n', '', '']
['TRIAL', '2023-05-31 11:43:40.806068', '', '', 'New trial', '']
['EVENT', '2023-05-31 11:43:40.816268', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:40.816771', '', '', 'WaitForCenterPoke', '']

['EVENT', '2023-05-31 11:43:44.730820', '', '', '44', 'Port2In']
['TRANSITION', '2023-05-31 11:43:44.730986', '', '', 'PreStimReward', '']
['EVENT', '2023-05-31 11:43:44.740809', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:44.740978', '', '', 'TriggerWaitForStimulus', '']
['EVENT', '2023-05-31 11:43:44.760811', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:44.760895', '', '', 'WaitForStimulus', '']
['EVENT', '2023-05-31 11:43:44.760977', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:44.761256', '', '', 'stimulus_delivery', '']
['EVENT', '2023-05-31 11:43:44.928123', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:44.928477', '', '', 'BeepMinSampling', '']
['EVENT', '2023-05-31 11:43:44.928582', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:44.928836', '', '', 'CenterPortRewardDelivery', '']
['EVENT', '2023-05-31 11:43:44.961520', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:44.961872', '', '', 'StimulusTime', '']
['EVENT', '2023-05-31 11:43:45.028618', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:45.029074', '', '', 'WaitCenterPortOut', '']
['EVENT', '2023-05-31 11:43:45.029174', '', '', '63', 'GlobalTimer1_End']
['TRANSITION', '2023-05-31 11:43:45.029250', '', '', 'timeOut_missed_choice', '']
['EVENT', '2023-05-31 11:43:45.039190', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:45.039560', '', '', 'ITI', '']
['EVENT', '2023-05-31 11:43:45.039650', '', '', '67', 'GlobalTimer5_End']
['EVENT', '2023-05-31 11:43:45.059208', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:45.059393', '', '', 'ext_ITI', '']
['EVENT', '2023-05-31 11:43:45.059489', '', '', '77', 'Condition5']
['END-TRIAL', '2023-05-31 11:43:45.059623', '', '', 'The trial ended', '']
['INFO', '2023-05-31 11:43:45.059668', '1685522620.806183', '1685522625.0594468', 'TRIAL-BPOD-TIME', '4.253263711929321']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059704', '0.010018348693847656', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059736', '3.924581289291382', '', '44', 'Port2In']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059764', '3.9345827102661133', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059790', '3.9545962810516357', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059819', '3.9547641277313232', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059845', '4.1218860149383545', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059873', '4.122363567352295', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059899', '4.1552817821502686', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059926', '4.222383260726929', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059952', '4.222947359085083', '', '63', 'GlobalTimer1_End']
['EVENT-SUMMARY', '2023-05-31 11:43:45.059980', '4.232963800430298', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.060006', '4.233433723449707', '', '67', 'GlobalTimer5_End']
['EVENT-SUMMARY', '2023-05-31 11:43:45.060033', '4.2529661655426025', '', '78', 'Tup']
['EVENT-SUMMARY', '2023-05-31 11:43:45.060059', '4.253263711929321', '', '77', 'Condition5']
['STATE', '2023-05-31 11:43:45.060113', '0', '0.010018348693847656', 'ITI_Signal', '0.010018348693847656']
['STATE', '2023-05-31 11:43:45.060164', '0.010018348693847656', '3.924581289291382', 'WaitForCenterPoke', '3.914562940597534']
['STATE', '2023-05-31 11:43:45.060196', '3.924581289291382', '3.9345827102661133', 'PreStimReward', '0.010001420974731445']
['STATE', '2023-05-31 11:43:45.060226', '3.9345827102661133', '3.9545962810516357', 'TriggerWaitForStimulus', '0.02001357078552246']
['STATE', '2023-05-31 11:43:45.060268', '3.9545962810516357', '3.9547641277313232', 'WaitForStimulus', '0.0001678466796875']
['STATE', '2023-05-31 11:43:45.060298', '3.9547641277313232', '4.1218860149383545', 'stimulus_delivery', '0.16712188720703125']
['STATE', '2023-05-31 11:43:45.060340', '4.1218860149383545', '4.122363567352295', 'BeepMinSampling', '0.0004775524139404297']
['STATE', '2023-05-31 11:43:45.060370', '4.122363567352295', '4.1552817821502686', 'CenterPortRewardDelivery', '0.03291821479797363']
['STATE', '2023-05-31 11:43:45.060399', '4.1552817821502686', '4.222383260726929', 'StimulusTime', '0.06710147857666016']
['STATE', '2023-05-31 11:43:45.060428', '4.222383260726929', '4.222947359085083', 'WaitCenterPortOut', '0.0005640983581542969']
['STATE', '2023-05-31 11:43:45.060458', '4.222947359085083', '4.232963800430298', 'timeOut_missed_choice', '0.010016441345214844']
['STATE', '2023-05-31 11:43:45.060488', '4.232963800430298', '4.2529661655426025', 'ITI', '0.020002365112304688']
['STATE', '2023-05-31 11:43:45.060517', '4.2529661655426025', '4.253263711929321', 'ext_ITI', '0.00029754638671875']
['STATE', '2023-05-31 11:43:45.060553', 'nan', 'nan', 'StimDelayGrace', 'nan']
['STATE', '2023-05-31 11:43:45.060581', 'nan', 'nan', 'broke_fixation', 'nan']
['STATE', '2023-05-31 11:43:45.060608', 'nan', 'nan', 'early_withdrawal', 'nan']
['STATE', '2023-05-31 11:43:45.060635', 'nan', 'nan', 'TriggerWaitChoiceTimer', 'nan']
['STATE', '2023-05-31 11:43:45.060662', 'nan', 'nan', 'WaitForChoice', 'nan']
['STATE', '2023-05-31 11:43:45.060689', 'nan', 'nan', 'WaitForRewardStart', 'nan']
['STATE', '2023-05-31 11:43:45.060716', 'nan', 'nan', 'WaitForReward', 'nan']
['STATE', '2023-05-31 11:43:45.060742', 'nan', 'nan', 'RewardGrace', 'nan']
['STATE', '2023-05-31 11:43:45.060768', 'nan', 'nan', 'Reward', 'nan']
['STATE', '2023-05-31 11:43:45.060797', 'nan', 'nan', 'WaitRewardOut', 'nan']
['STATE', '2023-05-31 11:43:45.060824', 'nan', 'nan', 'RegisterWrongWaitCorrect', 'nan']
['STATE', '2023-05-31 11:43:45.060851', 'nan', 'nan', 'WaitForPunishStart', 'nan']
['STATE', '2023-05-31 11:43:45.060877', 'nan', 'nan', 'WaitForPunish', 'nan']
['STATE', '2023-05-31 11:43:45.060906', 'nan', 'nan', 'PunishGrace', 'nan']
['STATE', '2023-05-31 11:43:45.060932', 'nan', 'nan', 'Punishment', 'nan']
['STATE', '2023-05-31 11:43:45.060958', 'nan', 'nan', 'WaitPunishOut', 'nan']
['STATE', '2023-05-31 11:43:45.060984', 'nan', 'nan', 'timeOut_EarlyWithdrawal', 'nan']
['STATE', '2023-05-31 11:43:45.061011', 'nan', 'nan', 'timeOut_EarlyWithdrawalFlashOn', 'nan']
['STATE', '2023-05-31 11:43:45.061037', 'nan', 'nan', 'timeOut_IncorrectChoice', 'nan']
['STATE', '2023-05-31 11:43:45.061063', 'nan', 'nan', 'timeOut_SkippedFeedback', 'nan']
['stderr', '2023-05-31 11:43:45.061852', '', 'Before StateMatrix()', '', '']
['stderr', '2023-05-31 11:43:45.061888', '', '\n', '', '']
['stderr', '2023-05-31 11:43:45.062968', '', 'Before send_state_machine()', '', '']
['stderr', '2023-05-31 11:43:45.063002', '', '\n', '', '']
['stderr', '2023-05-31 11:43:45.067969', '', 'Before run_state_machine()', '', '']
['stderr', '2023-05-31 11:43:45.068011', '', '\n', '', '']
['TRIAL', '2023-05-31 11:43:45.068041', '', '', 'New trial', '']
['EVENT', '2023-05-31 11:43:45.078167', '', '', '78', 'Tup']
['TRANSITION', '2023-05-31 11:43:45.078398', '', '', 'WaitForCenterPoke', '']

['EVENT', '2023-05-31 11:43:45.528845', '', '', '45', 'Port2Out']

as you can all every state transition is a timer which hits immediately. I did Port2In and before i even clicked out the trial ended and restarted which is why you can Port2Out as the last output.

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 31, 2023

^^ WaitForChoice and ChoiceDeadline

Currently the pybpod task parameters settings are so that there is little to no time to make a choice. You centerpoke and before you can pokeout the trial is over. Gonna try to fix this by updating the config.py to reflect the settings in the matlab gui.

This didn't help and made things worse

Not all the changes made to config.py are seen in the gui. For exmaples. I changed ITI to =1 which can be seen but ChoiceDeadline I changed to =10 but in the gui it is still =0

@HenryJFlynn
Copy link
Owner

^^ ChoiceDeadline isn't the only problem. If you manually change its value in the gui, the same thing happens. I believe the problem is with the value of GlobalTimer1 which controls this transition

['TRANSITION', '2023-05-31 11:43:45.029074', '', '', 'WaitCenterPortOut', '']
['EVENT', '2023-05-31 11:43:45.029174', '', '', '63', 'GlobalTimer1_End']
['TRANSITION', '2023-05-31 11:43:45.029250', '', '', 'timeOut_missed_choice', '']

While in WaitCenterPortOut the timer ends so fast that a choice can't be made

@HenryJFlynn
Copy link
Owner

next steps: set break points in task_parameters and run protocol to trackd wo how ITI is set and then overwirteen with config data and compare that to choicedeadline which isn't being over writtne with config

@HenryJFlynn
Copy link
Owner

stepping through emulator_run_manual_override,py the variable task_parameters has the changes to ChoceDeadline and ITI which I made in the config file but only ITI is changes in the gui. The variable task_parameters which is using to create the GUI seen here:

class TaskParameters:

    _default_file = fullpath('config.py')

    def __init__(self, file_=None, open_gui=True):
        self._file = file_ or self._default_file
        self.task_parameters = None
        self._load()
        if open_gui:
            app = QApplication(sys.argv)
            self.GUI = TaskParametersGUI(self.task_parameters)
            app.exec_()
        self.task_parameters = AttrDict(**self.task_parameters)

the self.GUI = TaskParametersGUI(self.task_parameters) this self.task_parameters has the changes

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 31, 2023

.ui file portion for ITI

</item>
                 <item row="1" column="0">
                  <widget class="QLabel" name="iTILabel">
                   <property name="text">
                    <string>ITI</string>
                   </property>
                  </widget>
                 </item>
                 <item row="1" column="1">
                  <widget class="QSpinBox" name="ITI"/>
                 </item>

vs portion related to ChoiceDeadline

  <item row="3" column="0">
                  <widget class="QLabel" name="choiceDeadlineLabel">
                   <property name="text">
                    <string>ChoiceDeadline</string>
                   </property>
                  </widget>
                 </item>
                 <item row="3" column="1">
                  <widget class="QSpinBox" name="ChoiceDeadline"/>
                 </item>

they're the same so it is not something to do with how the gui was created. I went into Qt Designer and verified this

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 31, 2023

Variables which config isn't working with:

  1. ChoiceDeadline ( = 0 )
  2. Ports_LMAir ( = 0 )
  3. PreStimDelayCntrReward ( = 0 )
  4. Left,Cent,Right PokeAttenPct ( = 0 )
  5. PCTimeout ( = False)

Each default to zero or false even tho they are non-zero or true in config

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented May 31, 2023

the error are caused by spelling errors/discrepancies. Must edit .ui with Qt Designer and edit config to match.

In doing this I somehow broke it and am getting a calibration error so i am gonna restart

See #17

@HenryJFlynn
Copy link
Owner

Two problems:

  1. No time to make a choice, likely GlobalTimer1 is set very small
  2. When Ports_LMRAir config settings are picked up by the gui (like they should be) it pops an error. See Fix config and Gui spelling errors #17

@HenryJFlynn
Copy link
Owner

Global timer issue:
In pybpod, the timer is set by this

self.set_global_timer(1, FeedbackDelayCorrect)
...
 FeedbackDelayCorrect = iff(data.Custom.CatchTrial[
            i_trial], Const.FEEDBACK_CATCH_CORRECT_SEC,
            task_parameters.FeedbackDelay)

in matlab

sma = SetGlobalTimer(sma,TimerIDChoiceDeadLine,TaskParameters.GUI.ChoiceDeadLine);

I think the values of all the globaltimer has been jumbled. Globaltimer1 shouldn't be defined by FeedbackDelayCorrect but globaltimer2 should be

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented Jun 1, 2023

Two problems:

  1. No time to make a choice, likely GlobalTimer1 is set very small
  2. When Ports_LMRAir config settings are picked up by the gui (like they should be) it pops an error. See Fix config and Gui spelling errors #17
  1. For the global timer fix see Correct global timers #19 and 13d7973
  2. For Ports_LMRAir Fix see Fix Ports_LMRAir #20

@HenryJFlynn
Copy link
Owner

Now am trying to get every state triggered, essentially stress testing the protocol

@HenryJFlynn
Copy link
Owner

HenryJFlynn commented Jun 1, 2023

After CenterPokeIn, a choice is presented that light (left or right) stays on in matlab for the entirety of WaitForChoice but it does not in python.

['EVENT', '2023-06-01 14:39:02.669515', '', '', '44', 'Port2In']
['TRANSITION', '2023-06-01 14:39:02.669700', '', '', 'PreStimReward', '']
['EVENT', '2023-06-01 14:39:02.679525', '', '', '78', 'Tup']
['TRANSITION', '2023-06-01 14:39:02.679735', '', '', 'TriggerWaitForStimulus', '']
['EVENT', '2023-06-01 14:39:02.699564', '', '', '78', 'Tup']
['TRANSITION', '2023-06-01 14:39:02.699698', '', '', 'WaitForStimulus', '']
['EVENT', '2023-06-01 14:39:02.699796', '', '', '78', 'Tup']
['TRANSITION', '2023-06-01 14:39:02.700116', '', '', 'stimulus_delivery', '']
['EVENT', '2023-06-01 14:39:02.866920', '', '', '78', 'Tup']
['TRANSITION', '2023-06-01 14:39:02.867315', '', '', 'BeepMinSampling', '']
['EVENT', '2023-06-01 14:39:02.867419', '', '', '78', 'Tup']
['TRANSITION', '2023-06-01 14:39:02.867688', '', '', 'CenterPortRewardDelivery', '']
['EVENT', '2023-06-01 14:39:02.900338', '', '', '78', 'Tup']
['TRANSITION', '2023-06-01 14:39:02.900690', '', '', 'StimulusTime', '']

Turning off the light is set somewhere in this, i think

@HenryJFlynn
Copy link
Owner

python the correct answer is always right

@HenryJFlynn
Copy link
Owner

Now am trying to get every state triggered, essentially stress testing the protocol

This is a general goal and not really an issue. Gonna use this idea to find problems which will become issues.

With that I am gonna close this issue

@github-project-automation github-project-automation bot moved this from In Progress to Done in Mouse2AFC Protocol Jun 1, 2023
HenryJFlynn pushed a commit that referenced this issue Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants