Howdy, Stranger!

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

Supported by

Maximun length in a cell of data matrix

Hello,

I am using data matrix in order to fill loop in open sesame (I find it more convenient loading first the variable then filling the loop by using data matrix).
Anyway my issue is as follow. I have string of 64 characters made of 0 and 1, because I use this binary coding for filling a matrix of square with various patterns represented by these strings.
So I first created lists of stims, then I create a data matrix object from these lists that I use as a loop.
This strategy worked but not with so long strings apparently:

import numpy as np
from datamatrix import DataMatrix


dmSymPract = DataMatrix(length = 15)

dmPractice_Sym_Stim_Coord = list()
dmPractice_Sym_Stim_Correctness = list()

dmPractice_Sym_Stim_Coord.append('0001100000011000001111000111111011111111011001100011110000011000') #1
dmPractice_Sym_Stim_Correctness.append(True)
dmPractice_Sym_Stim_Coord.append('1100001111100111110110111011110110011001101111011100001111111111') #2
dmPractice_Sym_Stim_Correctness.append(True)

dmPractice_Sym_Stim_Coord.append('1111111100111100000110000011110000100100001001000011110001011010') #3
dmPractice_Sym_Stim_Correctness.append(True)

dmPractice_Sym_Stim_Coord.append('1100001111000011111111110011110000111100111111111100001111000011') #4
dmPractice_Sym_Stim_Correctness.append(True)

dmPractice_Sym_Stim_Coord.append('1111111101111110111111110001100000011000111111110111111011111111') #5
dmPractice_Sym_Stim_Correctness.append(True)

dmPractice_Sym_Stim_Coord.append('1111111111011011010000101101101111011011010000101101101111111111') #6
dmPractice_Sym_Stim_Correctness.append(True)

dmPractice_Sym_Stim_Coord.append('1100001101100110001111001111111111111111001111000110011011000011') #7
dmPractice_Sym_Stim_Correctness.append(True)

dmPractice_Sym_Stim_Coord.append('1111101100100110110000100111111101111111110000100010011011111011') #8
dmPractice_Sym_Stim_Correctness.append(False)

dmPractice_Sym_Stim_Coord.append('0000000111000011111001111111110110000001101111111110011111000011') #9
dmPractice_Sym_Stim_Correctness.append(False)

dmPractice_Sym_Stim_Coord.append('0010010011111111101011011011010110111101101111011111111100100100') #10
dmPractice_Sym_Stim_Correctness.append(False)

dmPractice_Sym_Stim_Coord.append('1011110101011010100110011111111111111111100010010100101010111101') #11
dmPractice_Sym_Stim_Correctness.append(False)

dmPractice_Sym_Stim_Coord.append('1110011110100110111111111010011010100110111111111010011011100111') #12
dmPractice_Sym_Stim_Correctness.append(False)

dmPractice_Sym_Stim_Coord.append('1111111111101011110100111100101111010011010010101101011111111111') #13
dmPractice_Sym_Stim_Correctness.append(False)

dmPractice_Sym_Stim_Coord.append('1111111101000110111001111110011111100111111001110100011011111111') #14
dmPractice_Sym_Stim_Correctness.append(False)

dmPractice_Sym_Stim_Coord.append('1111011111111111110000110111111001111110110000111111111111101111') #15
dmPractice_Sym_Stim_Correctness.append(False)

np_Practice_Sym_Stim_Coord = np.transpose([dmPractice_Sym_Stim_Coord])
np_Practice_Sym_Stim_Correctness = np.transpose([dmPractice_Sym_Stim_Correctness])

np_Practice_Sym_Stim = np.stack((np_Practice_Sym_Stim_Coord, np_Practice_Sym_Stim_Correctness), axis=-1)

np_Practice_Sym_Stim = np.squeeze(np_Practice_Sym_Stim, axis=1)



dmSymPract = DataMatrix(length = 15)
dmSymPract.StimSym = ''
dmSymPract.Correctness = ''

dmSymPract.StimSym[0] = np_Practice_Sym_Stim[0][0] # doesnt work
dmSymPract.StimSym[0] = str(np_Practice_Sym_Stim[0][0]) # doesnt work
dmSymPract.StimSym[0] = '0001100000011000001111000111111011111111011001100011110000011000' # doesnt work
dmSymPract.StimSym[0] = 0001100000011000001111000111111011111111011001100011110000011000 # doesnt work

So the traceback I have everytime is:
Traceback:
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\inline_script.py", line 96, in run
self.experiment.python_workspace._exec(self.crun)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\python_workspace.py", line 174, in _exec
exec(bytecode, self._globals)
Inline script, line 11, in
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\datamatrix_datamatrix_basecolumn.py", line 781, in setitem
self._setintkey(key, value)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\datamatrix_datamatrix_basecolumn.py", line 518, in _setintkey
self._seq[key] = self._checktype(value)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\datamatrix_datamatrix_basecolumn.py", line 344, in _checktype
raise TypeError('Invalid type: %s' % value)
TypeError: Invalid type: 1100000011000001111000111111011111111011001100011110000011000

Thanks for any help!

Sylvain

Comments

  • Damn there is a typo in my script ( but it does not change the issue).
    The line:

    np_Practice_Sym_Stim = np.stack((np_Practice_Sym_Stim_Coord, np_Practice_Sym_Stim_Correctness), axis=-1)
    

    is actually

    np_Practice_Sym_Stim = np.stack((np_Practice_Sym_Stim_Coord, np_Practice_Sym_Stim_Correctness), axis= 1)
    

    Sorry!

  • Hi Sylvain,

    Right—what happens here is that DataMatrix tries to process this string as a number. But because it's such a big number, it becomes a long type, and DataMatrix doesn't accept that. I'll fix this in an upcoming release of DataMatrix. For now, if this is possible, you could use strings that are clearly not numbers, for example prefixing a '_' character or something.

    Cheers,
    Sebastiaan

  • Perfect thank you!

    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