Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Version of Psychopy on OSX right now: safe to upgrade?

Hey,

OK so this post is still about a task I am trying to implement, the same as here http://forum.cogsci.nl/index.php?p=/discussion/4106/problem-with-element-clicked-for-arrows#latest but here I have another issue.

I use psychopy as my back end.

OK so I was implementing the task on opensesame 3.2.4 on windows.

I generated arrows with this script and it was working quite well:

import numpy as np


# calculate length total of an arrow,its position at the beginningm and its position at the end
# relatively to the height of the screen
def calc_parameter_arrow(prop_length_arrow, prop_start_point_arrow):
    length_total = int(prop_length_arrow*var.height)
    pos_arrow_begin = int(prop_start_point_arrow*var.height)
    pos_arrow_final_long = length_total + pos_arrow_begin
    return (length_total, pos_arrow_begin, pos_arrow_final_long)


# convert polar to cartesian
def pol2cart(rho, phi):
    x = rho * np.cos(phi)
    y = rho * np.sin(phi)
    return(int(round(x)), int(round(y)))

# transform a length according to various radian, and return a list of list with the x, y cartesian coordinate of this length for these various radians

def coord_cart_radians(length_given, list_radian):
    deg_rad_pos = map(( lambda x: [length_given, x]), list_radian)
    cartesian_pos_return = [pol2cart(p[0], p[1]) for p in deg_rad_pos]
    return(cartesian_pos_return)

#calculate radian of arrow separated by 45 degrees
nbr_arrow = 8.
degree_sep = 45.
deg = np.arange(nbr_arrow) * degree_sep
var.deg_rad = np.radians(deg)
var.deg_name = [ int(x) for x in deg ]

# various proportion of arrow relative to the height of the screen
var.prop_arrow_long_length_height = 0.3
var.prop_start_point_arrow_long = 0.1


length_arrow_long_total, pos_arrow_begin_long, pos_arrow_final_long = calc_parameter_arrow(var.prop_arrow_long_length_height, var.prop_start_point_arrow_long)

cartesian_pos_arrow_final_long = coord_cart_radians(pos_arrow_final_long, var.deg_rad)
cartesian_pos_arrow_begin_long = coord_cart_radians(pos_arrow_begin_long, var.deg_rad)


Pratice_arrow_long_Instruct_canvas = Canvas()

for pos, (coord_cart_b, coord_cart_f) in enumerate(zip(cartesian_pos_arrow_begin_long, cartesian_pos_arrow_final_long)):    

    Pratice_arrow_long_Instruct_canvas['long_arrow%s' % int(var.deg_name[pos])] = Arrow(coord_cart_b[0],coord_cart_b[1], coord_cart_f[0], coord_cart_f[1], head_width = 50, body_length = 0.8, body_width = 0.5, fill = True, color = 'black')

my_mouse = Mouse(visible=True)
counter = -1
Pratice_arrow_long_Instruct_canvas.show()


while counter <15:
    button,  (x, y), timestamp = my_mouse.get_click()
    var.element_clicked = Pratice_arrow_long_Instruct_canvas.elements_at(x, y)
   counter+=1
    Pratice_arrow_long_Instruct_canvas.show()

Here was the result on windows:

Same script on the version 3.2.4 (same version as windows) on osx:

So well I noticed that on the version of osx the version of psychopy was the 1.82.01.

I updated it with pip within open sesame and now I get this:

For some reasons arrows became blue (current version of psychopy 1.90.1). And no matter what I do it stays blue.

Now something else that happened.
In the same experiment I first generate some image with psychopy then use them as stimulus.

from psychopy import visual, core

var.list_letter_orientation = list()

mywin = visual.Window([var.width,var.height], color = var.background)

text_presented = visual.TextStim(win=mywin,font=var.font_family, color = 'black', height = 0.3)

orientation_letter = range(0,360,45)

letter_list = ['F', 'G', 'J', 'R', 'L']

for letter_selected in letter_list:
    text_presented.text = letter_selected


    for int_orient in orientation_letter:
        text_presented.ori = int_orient
        text_presented.draw()
        mywin.getMovieFrame(buffer='back')
        path_file_name = exp.experiment_path + '/' + letter_selected+ '_' + str(int_orient) + '.png'
        var.list_letter_orientation.append(letter_selected+ '_' + str(int_orient) + '.png')
        mywin.saveMovieFrames(path_file_name)
        mywin.clearBuffer()

mywin.close()

When I tried to do that still on OSX, on psychopy 1.82.01 I encountered this error (while it was running well on the version of windows).

https://github.com/psychopy/psychopy/issues/991

Apparently upgrading psychopy resolved this too. But now I have this blue arrow issue which is very odd, and I wonder if what I did by upgrading is safe.

Thanks!

Best,

Sylvain

Comments

  • Hey,

    OK so I just tried the same thing on ubuntu (without upgrading psychopy) and got the same traceback for the second issue I was refering to.

    What solved at least the consistency between OSX and windows is upgrading psychopy with the version 1.85.3 (that is the one the windows version is coming with) on OSX.

    Just did:

    import pip
    pip.main(['install', 'psychopy==1.85.3', '--upgrade'])
    

    Now for some reason I struggle to upgrade my ubuntu version. When doing the same thing (with pip) I got the traceback:

    pip.main(['install', 'psychopy==1.85.3', '--upgrade'])

    AttributeError Traceback (most recent call last)
    in ()
    ----> 1 pip.main(['install', 'psychopy==1.85.3', '--upgrade'])

    AttributeError: 'module' object has no attribute 'main'

    Yeah it is complicated but I have to switch between the three versions for reasons beyond me.

    Best,

    Sylvain

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games