-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temp pool ressouce files written on disk on each trial #24
Comments
Thanks for this! I understand the idea, but fixing the pool folder will not really change anything because the Just to clarify this for me: What is the issue that you're trying to address? Is it that OMM creates many temporary pool folders that are never cleaned up? If so, then this would indeed solve it, but it's no longer necessary because it's already fixed in the main OpenSesame code. Or do you want to speed up the process by avoid unnecessary extraction of the file pool each time that a trial is started? If so, then this won't change that, unfortunately. |
Hello, you are right., thank you for the clarification. Since I am working on a Raspberry Pi and the read/write speed is slow and I don't have much disk space, I am looking to avoid writing the same files multiple times for two reasons: 1) to not consume too much disk space, and 2) to improve execution speed. I haven't tested everything, but this seems to address both issues :
But for this to work, you obviously need to comment out the last line (#os.remove(script_path)) of the _read_tarfile function in the 'osexpfile/_osexpreader.py' file. |
Ok, I see. I'm willing to accept a patch along these lines, but not implemented like this, because it would require the main OpenSesame code to be hacked in order to make this possible. Here's how I would approach this:
Does that make sense? If you want to implement this, please submit it as a pull request and also include tests to make sure that this works properly. There's a lot of room for breakage with things like this! |
From what I understand, if I use 'OSExpReader' as is, I will never have the script in the cache folder. This is because the '_read_tarfile' method deletes the script right after decompressing it. So, for me, the only way to avoid modifying the main Opensesame code would be to rewrite the 'OSExpReader' class for OMM (that does not delete the script) , which would be used to decompress the osexp file. Are you agree with that, or am I missing something? I understand that modifying the main code is generally to be avoided, but what is the point of deleting the script from the cache? Leaving it there changes nothing, and it will be removed during the 'pool' cleanup by Opensesame. I think it makes sense to keep the script with the resource files |
Ah yes, that's true. The script itself (as a string) is still preserved at the |
Each time a chip is detected, the resource files (images, sounds, videos...) are written to the disk in a temporary folder, even if the experiment is the same. (FilePoolStore does not receive a 'folder' argument.)
The proposed solution is to modify the _get_osexp function of the OpenMonkeyMind class, and to proceed in the same way as for the 'osexp' file, by passing the 'pool_folder' argument to Experiment.
The text was updated successfully, but these errors were encountered: