thartbm / PyVMEC

A Python-based GUI to create and run visuo-motor experiments.
GNU General Public License v3.0
1 stars 3 forks source link

'no experiment selected' pop-up after typing participant ID #57

Closed thartbm closed 6 years ago

thartbm commented 6 years ago

Marco and me tried to get some more information about the SPACE bar issue so we created a short experiment with many tasks and tried to run it on ourselves, but at some point PyVMEC started playing up even more: We edit the experiment a bit and start it again. It asks for a participant ID and we type it. PsychoPy creates a Window (but doesn't hide the mouse cursor) and then there's a pop-up saying 'no experiment selected'.

1) This pop-up would be invisible for people without a second monitor, so it should be tested before a PsychoPy Window is created, or when the test fails, the exit function should be called to close everything down before showing that pop-up.

2) An experiment was selected, as the new IDs actually show up in the list of participants for that experiment (without data of course)... how can this be?

juliusjgm12 commented 6 years ago

I'm not sure, I've tried clicking randomly around the PsychoPy Window and i'm not getting this issue.

I also tried pressing space multiple times during runtime and didn't get any error messages, even with the window in windowed mode (so i could see if the error popped up).

thartbm commented 6 years ago

We'll try to recreate this particular error, for some reason everybody deleted the experiments that show this.

In any case, there should be a test that creates the pop-up when the test fails, and that code is not structured logically. That test should be moved to a timepoint before the creation of the psychopy window. Or, if the test fails, the psychopy window should be destroyed before the pop-up is created. Otherwise, people on a 1-screen setup will be stuck.

shanaam commented 6 years ago

I couldn't figure out if I can send you photos over GitHub so I sent you pictures of the error we are getting on slack Julius.

shanaam commented 6 years ago

no_experiment_selected_error pause_instruction_error

shanaam commented 6 years ago

I've attached the .json file where I'm getting the error. It seems to be happening when starting up the "rotated_training_60_2" task. I can't see any obvious difference at that task in the .json file but you'd know more than me.

Hope this helps! -Shanaa rigit_exp_IE.zip

thartbm commented 6 years ago

Well... there is no 'pause_instruction' key in the dictionary for that task, as the error says. There's a chance that if you add a "pause_instruction": " " to the dict for that task it will now stop at the task after ("no-cursor_60_include_2"), since that one also doesn't have a 'pause_instruction' key (so you want to add it there too). And then there are some more. However, some tasks before are also missing that key, so perhaps it won't work.

An alternative is to take those tasks out completely and re-create them so they have all the necessary keys.

Long term, PyVMEC should not be looking for (or creating) keys that are not applicable.

juliusjgm12 commented 6 years ago

I think I've pinpointed the issue that caused Shanaa's longer experiment to halt. My suspicion is that the screeninfo.get_monitors() module function was opening some background client to open and not closing it until after the PyVMEC is closed. I made it so it now only calls that module once when running an experiment. Also I've made a key check when the run button is pressed that fills in any missing keys in an experiment with a default value so the key error should no longer be happening.