-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add clear-cache #60
Add clear-cache #60
Conversation
Co-authored-by: Cédric St-Jean <cedric.stjean@gmail.com>
It seems that this PR is not making progress. Is there anything I can do? |
If you do module A
@memoize foo(x) = x
end
using A: foo
@clear_memoize_cache foo I don't believe it would work, right? I'm sorry that I didn't think of it earlier. I think that |
Or even better, |
Thank you for looking into it again. Well spotted; no worries, I should have noticed that the functionality wasn't handling modules properly. I've changed it to The new functionality is also documented again in the README. I've changed
into
which I think is more clear to readers. |
I don't think that would work in another module. Try the example I gave: module A
@memoize foo(x) = x
end
using A: foo
@clear_memoize_cache foo If you implement |
Isn't that what is tested with
in the tests? If I understand correctly, this is the example you gave
|
Oh, and the build appears to be failing on Julia 1.1 with
It seems that I need to fix that. |
On second thought, I'm not going to invest time on Julia 1.1. I did that at GiovineItalia/Gadfly.jl#1496 and it was not a good time investment. Let me know if I can make changes to improve the functionality on Julia 1.5. If Julia 1.1 is a must, then feel free to close this PR. |
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.
I wouldn't mind dropping 1.1 if it makes things easier and it's necessary.
Right, sorry that I didn't read the code properly. |
No problem; it happens I've now used
In Julia 1.2 the tests pass, so I've bumped the Julia version to 1.2. |
Thanks! |
Will merge when the checks are green again. |
This PR is an attempt to implement clearing of the cache (#14).
EDIT: In a previous version of this comment, I stated that other types than
IdDict
needed to be considered. SinceBase.empty!
takes collections, I believe that the code should now work for any relevant type.