Skip to content
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

MethodError: objects of type (...) are not callable #27

Closed
Omar-Elrefaei opened this issue May 17, 2023 · 1 comment
Closed

MethodError: objects of type (...) are not callable #27

Omar-Elrefaei opened this issue May 17, 2023 · 1 comment

Comments

@Omar-Elrefaei
Copy link

Hi,
Thanks for the awesome package. It really made some workflow yesterday quite smooth when I needed to iterate over the "presentation" of some dataframe but it'd have been quite painful to decouple that from the heavy computation for such a small one-off script.
Used it nicely with ThreadSafeDict.

But when things were accumulating too much in memory I was looking at LRUCache, but I've been getting:

julia> @memoize LRU(maxsize=5) function mycond(x)
          	println(x);
			return cond(x)
       end
ERROR: MethodError: objects of type LRU{Matrix{Float64}, Float64} are not callable
Stacktrace:
 [1] #s44#53
   @ C:\Users\elom\.julia\packages\Memoization\xgAKx\src\Memoization.jl:173 [inlined]
 [2] var"#s44#53"(::Any, #unused#::Any)
   @ Main .\none:0
 [3] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any})
   @ Core .\boot.jl:580
 [4] get_caches()
   @ Memoization C:\Users\elom\.julia\packages\Memoization\xgAKx\src\Memoization.jl:58
 [5] find_caches(func::typeof(_cond12))
   @ Memoization C:\Users\elom\.julia\packages\Memoization\xgAKx\src\Memoization.jl:81
 [6] empty_cache!(func::Function)
   @ Memoization C:\Users\elom\.julia\packages\Memoization\xgAKx\src\Memoization.jl:80
 [7] top-level scope
   @ C:\Users\elom\.julia\packages\Memoization\xgAKx\src\Memoization.jl:180

I've skimmed #4 and when you said

Ok, so syntax like @memoize DiskDict("foo.dat") foo(x) = .... now works on master.

That doesn't seem to be the case anymore. Maybe there was a recent regression?
in fact I get the same error when I try your JLD2BackedDicts example.

Note: I am using v0.2 and Julia v1.7.2

@marius311
Copy link
Owner

Sorry for the super late reply but I just tried this and it looks to be working on 0.2.1 (currently the latest version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants