Variable orientation produces NoneType error

What are you trying to achieve?:
I am trying to create a version of the Attention Network Task in PsychoPy using materials which I have downloaded from Pavlovia. I need a target to appear either above or below a fixation cross and since the Pavlovia materials only have an image of the target in the above position, I need to set the orientation of the target to be variable so that it can appear either above (orientation = 0 degrees) or below (orientation = 180 degrees) the fixation cross

Here is the original experiment: demos / The Attention Network Task · GitLab
And here is a link to my version: https://gitlab.pavlovia.org/omaraftab/ant-trial-2

What is the problem?:
As far as I can see, I have copied the original experiment exactly which is puzzling because the original experiment is running smoothly (so surely I haven’t copied it exactly!).

I have a conditions file (see below) and I have set the orientation of the target to a variable called $targOrientation, corresponding to a column in the conditions file.

On running the experiment, the following error is displayed:

TypeError: float() argument must be a string or a number, not ‘NoneType’

Is this related to the zeroes in the conditions file? I have edited the original conditions file (added in extra columns) but the original experiment also uses a conditions file with many zeroes.

To confuse matters more, I have noticed that the original experiment actually has the orientation of the target set to “$ $targOrientation” - i.e., it uses the dollar sign despite this already being there by default (see below).

Double Dollar

When I edit my own experiment so that I also have two dollar signs, I get a syntax error.

Any thoughts?

Hello,

no $-sign in orientation. But anyway, orientation does not determine the position of the stimulus on the screen, but its orientation in degrees. See here

Best wishes Jens

Hi Jens,

Thanks for your reply.

I had a look at the solution you linked but as far as I can see (and I apologise if I’m mistaken!), it’s essentially the same thing as what I am currently doing, which is returning the NoneType error described above.

If you look at my conditions file, you will see that I have a column called targOrientation which I am trying to use to vary the target’s orientation. However, PsychoPy does not appear to be reading the information in this column as I would like.

Also, I should explain again that the screenshot I sent in which there is two dollar signs is not actually from the version of the task which I made, but rather from a version that I downloaded. This version actually happens to be running perfectly (which is really confusing me!).

I understand that orientation does not actually change the position of the stimulus, but because of the way my target looks, rotating it by 180 degrees actually does make it appear that the target has moved below the fixation cross.

Hello

do you use the name TargOrientation multiple times in your experiment?

Best wishes Jens

Hi Jens,

On rechecking the code yesterday I realised that the NoneType error wasn’t actually related to the orientation of the target at all, but to one of the other images in the same routine. I have edited the code and the experiment is now running smoothly - thanks for your suggestions nonetheless!