mcabbott / mcabbott/TensorCast.jl
World Age Issues with TensorCast calls from pyJulia
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 142
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
I am getting a world age bug when running TensorCast in JuliaPy, but not when using it normally.
If I run an example function such as
function testfunc()
V = [10,20,30]
M = collect(reshape(1:12, 3,4))
@cast A[j,i] := M[i,j] + 10 * V[i]
return A
end
it works when I call it in Julia via
A = testfunc()
However, when I run the Python script
from julia.api import Julia
jl = Julia(compiled_modules=False)
from julia import Main
Main.include("testfunction.jl")
from julia.Main import testfunc
A = testfunc()
I get the error
<PyCall.jlwrap (in a Julia function called from Python)
JULIA: MethodError: no method matching _trex(::Symbol, ::Type{Matrix{Int64}}, ::Tuple{Int64, Int64})
The applicable method may be too new: running in world age 32486, while current world is 38140.
Closest candidates are:
_trex(::Any, ::Any, ::Any) at /home/andrewhardy/.julia/packages/TransmuteDims/mGkQB/src/TransmuteDims.jl:372 (method too new to be called from this world context.)
which only occurs for the @cast call. What can I do?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the difference between the direct Julia call and the pyJulia script in testfunction.jl, focusing on the @cast call and the reported TransmuteDims.jl location. Compare the execution context and method availability, then confirm that testfunc() succeeds from Python without the world-age MethodError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100