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

precompiletools fails on savecube #349

Open
bjarthur opened this issue Oct 31, 2023 · 1 comment
Open

precompiletools fails on savecube #349

bjarthur opened this issue Oct 31, 2023 · 1 comment

Comments

@bjarthur
Copy link

contents of MyPkg/src/MyPkg.jl:

using PrecompileTools, YAXArrays, Zarr
@setup_workload begin         
    @compile_workload begin   
        A = YAXArray(rand(2,3,4))
        savecube(A, tempname(), driver=:zarr)
    end
end

strangely, :zarr is not found when using that package:

julia> using MyPkg
[ Info: Precompiling MyPkg [a54793ad-6546-4bc9-b456-c4a67c0445e2]
ERROR: LoadError: KeyError: key :zarr not found
Stacktrace:
  [1] getindex(h::OrderedCollections.OrderedDict{Symbol, Any}, key::Symbol)
    @ OrderedCollections ~/.julia/packages/OrderedCollections/SInLM/src/ordered_dict.jl:385
  [2] backendfrompath(g::String; driver::Symbol)
    @ YAXArrayBase ~/.julia/packages/YAXArrayBase/R6Frw/src/datasets/datasetinterface.jl:89
  [3] backendfrompath
    @ ~/.julia/packages/YAXArrayBase/R6Frw/src/datasets/datasetinterface.jl:79 [inlined]
  [4] savedataset(ds::YAXArrays.Datasets.Dataset; path::String, persist::Nothing, overwrite::Bool, append::Bool, skeleton::Bool, backend::Symbol, driver::Symbol, max_cache::Float64, writefac::Float64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ YAXArrays.Datasets ~/.julia/packages/YAXArrays/no0he/src/DatasetAPI/Datasets.jl:544
  [5] savecube(c::YAXArrays.Cubes.YAXArray{Float64, 3, Array{Float64, 3}, Tuple{DimensionalData.Dimensions.Dim{:Dim_1, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, DimensionalData.Dimensions.Dim{:Dim_2, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, DimensionalData.Dimensions.Dim{:Dim_3, DimensionalData.Dimensions.LookupArrays.Sampled{Int64, Base.OneTo{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, path::String; layername::String, datasetaxis::String, max_cache::Float64, backend::Symbol, driver::Symbol, chunks::Nothing, overwrite::Bool, append::Bool, skeleton::Bool, writefac::Float64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
<SNIP>

yet if i run the contents of the @compile_workload block manually, it runs fine:

julia> using PrecompileTools, YAXArrays, Zarr

julia> A = YAXArray(rand(2,3,4))
2×3×4 YAXArray{Float64,3} with dimensions: 
  Dim{:Dim_1} Sampled{Int64} Base.OneTo(2) ForwardOrdered Regular Points,
  Dim{:Dim_2} Sampled{Int64} Base.OneTo(3) ForwardOrdered Regular Points,
  Dim{:Dim_3} Sampled{Int64} Base.OneTo(4) ForwardOrdered Regular Points
Total size: 192.0 bytes


julia> savecube(A, tempname(), driver=:zarr)
2×3×4 YAXArray{Float64,3} with dimensions: 
  Dim{:Dim_1} Sampled{Int64} Base.OneTo(2) ForwardOrdered Regular Points,
  Dim{:Dim_2} Sampled{Int64} Base.OneTo(3) ForwardOrdered Regular Points,
  Dim{:Dim_3} Sampled{Int64} Base.OneTo(4) ForwardOrdered Regular Points
Total size: 192.0 bytes
@bjarthur
Copy link
Author

let me know if i should file this issue with precompiletools instead

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

1 participant