Condition file information not being extracted

URL of experiment:

  1. theodoros kapogianis / dm_nsgl · GitLab
  2. Sign in · GitLab

I am posting 2 experiments here. dm_nsgl is my actual experiment. derp2 is a small, toy experiment I am using to troubleshoot problems.

Description of the problem:

  1. theodoros kapogianis / dm_nsgl · GitLab
  2. Sign in · GitLab

I have a routine (graph_upload) in both dm_nsgl & derp2 that has a condition loop used to upload a condition file which contains information to be used in my experiment.

I first noticed in dm_nsgl that the information within the file is not being extracted for this routine specifically.
I have a routine just before it called stim_upload which served to upload the path of all possible stimulus images. that information is being uploaded properly, I put a print statement to check. so all is well there.

I took a copy of the same file and upload it in the derp2 graph_upload routine condition loop, and the information (a list of lists) is being extracted (though not in the arrangement I would like bc of python → JS changes that occur, but that’s a different problem. the python list of lists results is one long JS array ).

I am uploading the files similarly in both experiments. does anyone have any idea what it may be that is resulting in this distinct behavior between the two experiments? Why can I extract the info in derp2 but not dm_nsgl?

Hi @theokapo, the second link gives a 404.

@ajus sorry! i forgot that the gitlab for that experiment was private still.
apologies! should work now

Can you say again, which routine in dm_nsgl you think should do the same thing as graph_upload in derp2? There is no graph_upload in dm_nsgl as far as I can see. And the routines that were similarly named all have different code in them.

graph_loader and prac_graph_loader are the same routines as graph_upload, they upload similarly formatted .csv files, but prac_graph_loader is the routine that uploads prac_toy_graphDataframe and is receiving the ‘unexpected indent’ error when syncing.

So, firstly, I don’t think the “unexpected indent” has anything to do with the csv file. It refers to some later routine that probably has faulty python code in it. Deleting all routines after the initial loops eliminates the error. I don’t know which routine produces the errors, but you may find out by going through them. Also, the error arises not specifically when syncing, but when the js is generated (which is only a part of syncing).

Second, can you explain specifically what you mean by “the information is not extracted”? What exactly would you expect and what happens instead?

  1. the error that arises downstream that you mentioned is the result of the info not being pulled from the .csv file and being saved in a variable that remains empty. later that variable is used to determine the number of loops, but bc the variable is undefined an error occurs bc .length() cannot be executed on an undefined js variable

  2. so the .csv file has contains informations about networks that I will be using. each column/parameter is a different category and each row a different network. some cells contain nested arrays of information.

but I can show you what is occurring when I attempt to pilot online.

derp2 is running correctly. It pulled the array of paths for stimulus images, which is in its own .csv file. it also pull the nodes parameter array, which is stored in graph_nodes.

dm_nsgl also pulled the array containing the list of stimulus paths (will fix those for relative paths later). however the nodes parameter is being returned as undefined. so graph_nodes remains as empty variable.

I was using a series of print statement to examine info as it is pulled from the .csv parameters and stored in global variables.
start_target_pairs is a .csv parameter that I wanted to examine the length of which returned undefined. as well.

Running dm_nsgl I am not able to replicate your console output. For me, every time “nodes” is logged it has a value. Maybe you just need to update to 2022.2.4

(I’ve heard that js does not like it when variables are defined twice and will give an “undefined” in this case, maybe that’s the problem with your experiment.)

i’ll update psychopy and let you know. When I run locally thing workout as intended, however when I attempt to pilot online on pavlovia that is where the issue arises. I can send a pilot link if that would be helpful

By „locally“ do you mean PsychoPy or PsychoJS in local debug mode?

Locally I mean psychopy on my computer, it runs perfectly.
When I attempt to run it online with psychoJS I have those issues

Okay, I ran it in local debug mode and did not have the problem. So updating might actually fix it.