Howdy, Stranger!

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

Supported by

Memoize permission Error

edited June 14 in DataMatrix

I've been working on a project in which I've decided to analyze both pupils. For this I'm using the eyelink parser, then load in the data twice (once for the right eye, once for the left eye). All this works perfectly, untill I get to 17 files. Suddenly i get the error message:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '.memoize\\.2839819153104-7068.memmap'

When I remove any file (tried multiple different ones) the error disappears and it works fine again. I accepted this as the limit, which is still found a little strange since 16 files is not that much, so I made an new folder, added the next 16 files in there, made the loading a function that uses the right paths and the eyelink parser. But then suddenly it can only take 10 files and not even 16 anymore. Made a new folder, that one could store 10 again, but the next one only 8. So i'm a little lost. It also does not seem to be caused by the size of the folder (they range from 800mb (do not work) to 1070 mb (still work)).

@fnc.memoize(persistent=True)
def get_data(folder_path):

    # The heavy lifting is done by eyelinkparser.parse()
    dm = parse(
        folder=folder_path,       # Folder path to .asc files
        traceprocessor=defaulttraceprocessor(
          blinkreconstruct=True,  # Interpolate pupil size during blinks
          downsample=10,          # Reduce sampling rate to 100 Hz,
          mode='advanced'         # Use the new 'advanced' algorithm
        )
    )
    dm = dm[dm.trialid, dm.blockcount, dm.invalid, dm.ptrace_bl, dm.ptrace_stim, dm.participant,
            dm.stim_con, dm.xtrace_stim, dm.ytrace_stim, dm.xtrace_bl, dm.ytrace_bl, dm.condition, dm.tact1]
    dm = dm.invalid == 0  # to filter all the invalid trials
    dm = dm.trialid != 0  # to filter the duplicate first trials

    return dm


get_data.clear()                                                           # clear data, otherwise is stored
left_folder = 'C:\\N&C Internship\\DATA_ANALYSIS\\Left_20_25'      # path for the left eye placebo
right_folder = 'C:\\N&C Internship\\DATA_ANALYSIS\\Right_20_25' 

this is the general code i use in which i can the folder paths to 1_8, 9_13, 14_19

Long story short, my question is: what are the limitations of the memoize function and how can i prevent this from happening? Is there a better way to load in all the data (I have 4 files per participant, 2 sessions x 2 eyes, 32 participants).

Any help is welcome, thank you in advance!

Comments

  • Hi @Bernd_Douze ,

    In general terms, what happens is that the size of the data exceeds the available memory. DataMatrix then starts to offload the data to disk, which results in .memmap files. Apparently, multiple processes are trying to access these files simultaneously, which Windows does not allow. This appears to be the situation, but I'm not sure why this situation arises. Can you post the full traceback?

    For now, reducing memory consumption may resolve the issue as well (because it will avoid memory offloading). To do so, you can use the phasefilter argument to retain only specific phases, the maxtracelen argument to make sure that traces aren't unnecessarily long, and the pupil_size , gaze_pos , and time_trace arguments to retain only the data that you need.

    — Sebastiaan

  • Thank you for taking the time to reply! I'll look into reducing the data size to see if that works. The full traceback is:

      File "C:\Users\bernd\PycharmProjects\N&C_Internship_Pupil&Touch\Data_analysis_pupil.py", line 60, in <module>
        dm_comb = get_data(left_folder)                    # get data from left_eye folder, 'comb' bc will add right to this
                  ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\bernd\PycharmProjects\N&C_Internship_Pupil&Touch\.venv\Lib\site-packages\datamatrix\_functional\_memoize.py", line 234, in _call_without_arguments
        return self._write_cache(
               ^^^^^^^^^^^^^^^^^^
      File "C:\Users\bernd\PycharmProjects\N&C_Internship_Pupil&Touch\.venv\Lib\site-packages\datamatrix\_functional\_memoize.py", line 324, in _write_cache
        io.writebin(retval, cache_path)
      File "C:\Users\bernd\PycharmProjects\N&C_Internship_Pupil&Touch\.venv\Lib\site-packages\datamatrix\io\_bin.py", line 143, in writebin
        aux_path.unlink()
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\pathlib.py", line 1147, in unlink
        os.unlink(self)
    PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '.memoize\\.2216457578384-18380.memmap'
    
    
    Process finished with exit code 1
    


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