shashi / FileTrees.jl

Parallel computing with a tree of files metaphor
http://shashi.biz/FileTrees.jl
Other
88 stars 6 forks source link

exec on Files #69

Closed DrChainsaw closed 1 year ago

DrChainsaw commented 2 years ago

Is it intentional that exec does nothing on Files?

julia> ff = File(nothing, "test", FileTrees.lazy(identity)(12))
File(test)

julia> exec(ff)[]
Thunk[91475](identity, Any[12])

It seems like it would be quite useful with mapsubtrees to get a partially loaded tree:

julia> t = maketree("root" => [(name="a", value=FileTrees.lazy(identity)(2)), (name="b", value=FileTrees.lazy(identity)(3))])
root/
├─ a (Thunk[91476](identity, Any[2]))
└─ b (Thunk[91477](identity, Any[3]))

julia> mapsubtrees(exec, t, r"b")  # Does nothing :(
root/
├─ a (Thunk[91476](identity, Any[2]))
└─ b (Thunk[91477](identity, Any[3]))

julia> FileTrees.exec(f::File) = setvalue(f, exec(f[]))

julia> mapsubtrees(exec, t, r"b")
root/
├─ a (Thunk[91476](identity, Any[2]))
└─ b (Int64)
shashi commented 1 year ago

I don't think that's intentional..