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

Feature request - add support for SparseMatrixCSC #1131

Open
elbert5770 opened this issue Nov 9, 2023 · 1 comment
Open

Feature request - add support for SparseMatrixCSC #1131

elbert5770 opened this issue Nov 9, 2023 · 1 comment

Comments

@elbert5770
Copy link

elbert5770 commented Nov 9, 2023

        cell_sparse_def = create_dataset(ga, "cell_sparse", datatype(cell_sparse), dataspace(cell_sparse))
        write(cell_sparse_def,cell_sparse)
MethodError: no method matching strides(::SparseMatrixCSC{Int64, Int64})

Closest candidates are:
  strides(!Matched::SubArray)
   @ Base subarray.jl:360
  strides(!Matched::Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {T, N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, Base.ReshapedArray{T, N, A} where {T, N, A<:Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {T, N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}}, DenseArray})
   @ Base reinterpretarray.jl:173
  strides(!Matched::Base.ReshapedArray)
   @ Base reshapedarray.jl:305
  ...

Stacktrace:
  [1] stride(A::SparseMatrixCSC{Int64, Int64}, k::Int64)
    @ Base .\abstractarray.jl:588
  [2] _check_invalid(dataset::HDF5.Dataset, buf::SparseMatrixCSC{Int64, Int64})
    @ HDF5 C:\Users\elber\.julia\packages\HDF5\Ws1wH\src\datasets.jl:501
  [3] write_dataset(dataset::HDF5.Dataset, memtype::HDF5.Datatype, buf::SparseMatrixCSC{Int64, Int64}, xfer::HDF5.DatasetTransferProperties)     
    @ HDF5 C:\Users\elber\.julia\packages\HDF5\Ws1wH\src\datasets.jl:521
  [4] write_dataset(dataset::HDF5.Dataset, memtype::HDF5.Datatype, buf::SparseMatrixCSC{Int64, Int64})
    @ HDF5 C:\Users\elber\.julia\packages\HDF5\Ws1wH\src\datasets.jl:521
  [5] write(obj::HDF5.Dataset, x::SparseMatrixCSC{Int64, Int64})
    @ HDF5 C:\Users\elber\.julia\packages\HDF5\Ws1wH\src\datasets.jl:335
  [6] (::var"#6#8"{Matrix{Float64}, Matrix{Int64}, Matrix{Float64}, SparseMatrixCSC{Int64, Int64}, Int64, Int64})(file::HDF5.File)
    @ Main C:\Users\elber\Documents\git\MicronsBinder\notebooks\intro\PlyToHdf5_20231107.jl:262
  [7] (::HDF5.var"#17#18"{HDF5.HDF5Context, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, var"#6#8"{Matrix{Float64}, Matrix{Int64}, Matrix{Float64}, SparseMatrixCSC{Int64, Int64}, Int64, Int64}, HDF5.File})()
    @ HDF5 C:\Users\elber\.julia\packages\HDF5\Ws1wH\src\file.jl:101
  [8] task_local_storage(body::HDF5.var"#17#18"{HDF5.HDF5Context, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, var"#6#8"{Matrix{Float64}, Matrix{Int64}, Matrix{Float64}, SparseMatrixCSC{Int64, Int64}, Int64, Int64}, HDF5.File}, key::Symbol, val::HDF5.HDF5Context)
    @ Base .\task.jl:296
  [9] h5open(::var"#6#8"{Matrix{Float64}, Matrix{Int64}, Matrix{Float64}, SparseMatrixCSC{Int64, Int64}, Int64, Int64}, ::String, ::Vararg{String}; context::HDF5.HDF5Context, pv::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ HDF5 C:\Users\elber\.julia\packages\HDF5\Ws1wH\src\file.jl:96
 [10] h5open(::Function, ::String, ::String)
    @ HDF5 C:\Users\elber\.julia\packages\HDF5\Ws1wH\src\file.jl:94
 [11] uniquenode(filename::String)
    @ Main C:\Users\elber\Documents\git\MicronsBinder\notebooks\intro\PlyToHdf5_20231107.jl:238
 [12] job_queue(cell_list::Matrix{Int64})
    @ Main C:\Users\elber\Documents\git\MicronsBinder\notebooks\intro\PlyToHdf5_20231107.jl:462
 [13] top-level scope
    @ C:\Users\elber\Documents\git\MicronsBinder\notebooks\intro\PlyToHdf5_20231107.jl:482
in expression starting at C:\Users\elber\Documents\git\MicronsBinder\notebooks\intro\PlyToHdf5_20231107.jl:482
@mkitti
Copy link
Member

mkitti commented Nov 10, 2023

This is a bit of tough one. JLD.jl or JLD2.jl might be a better fit for this.

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