-
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
Added the cache_file decorator #221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To which location is the cached file written to? I know from computer scientists that there is a certain folder called "/tmp" which is the default folder for cached files and temporary files.
However, this is OS dependent.
Windows: C:\Users\AppData\Local\Temp
Mac: ~/Library/Caches/
The function will create a directory called |
I think it's better to do it in the designated caching directory. I saw this through searching that could help. There is already a python package that deals with temp files called This causes you yourself not having to deal with os dependent stuff |
We now use the platformdirs module to deal with this. |
This decorator will cache results from function calls and save them to a file locally. This is usefull for functions that are very expensive to run or require the user to be online. Previous results can then be used if the user is offline.