diff --git a/NDTensors/Project.toml b/NDTensors/Project.toml index 1d6f5a9ab9..c367740318 100644 --- a/NDTensors/Project.toml +++ b/NDTensors/Project.toml @@ -1,7 +1,7 @@ name = "NDTensors" uuid = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" authors = ["Matthew Fishman "] -version = "0.3.70" +version = "0.3.71" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" diff --git a/NDTensors/src/backup/arraystorage/blocksparsearray/storage/contract.jl b/NDTensors/src/backup/arraystorage/blocksparsearray/storage/contract.jl index 7a8bf5217c..a02f9229d4 100644 --- a/NDTensors/src/backup/arraystorage/blocksparsearray/storage/contract.jl +++ b/NDTensors/src/backup/arraystorage/blocksparsearray/storage/contract.jl @@ -1,5 +1,5 @@ # TODO: Define in `SparseArraysBase`. -using ..SparseArrayDOKs: SparseArrayDOK +using ..SparseArraysBase: SparseArrayDOK # TODO: This is inefficient, need to optimize. # Look at `contract_labels`, `contract_blocks` and `maybe_contract_blocks!` in: diff --git a/NDTensors/src/imports.jl b/NDTensors/src/imports.jl index a78cc2736d..6a5f6343c7 100644 --- a/NDTensors/src/imports.jl +++ b/NDTensors/src/imports.jl @@ -39,7 +39,6 @@ for lib in [ :TensorAlgebra, :NestedPermutedDimsArrays, :SparseArraysBase, - :SparseArrayDOKs, :DiagonalArrays, :BlockSparseArrays, :NamedDimsArrays, diff --git a/NDTensors/src/lib/AllocateData/test/runtests.jl b/NDTensors/src/lib/AllocateData/test/runtests.jl index e1698b8879..b824651feb 100644 --- a/NDTensors/src/lib/AllocateData/test/runtests.jl +++ b/NDTensors/src/lib/AllocateData/test/runtests.jl @@ -3,7 +3,7 @@ using NDTensors.AllocateData: AllocateData, allocate, allocate_zeros, zero_init using LinearAlgebra: Diagonal, Hermitian using NDTensors.DiagonalArrays: DiagonalArray using NDTensors.BlockSparseArrays: BlockSparseArray -using NDTensors.SparseArrayDOKs: SparseArrayDOK +using NDTensors.SparseArraysBase: SparseArrayDOK using Test: @test, @testset, @test_broken, @test_throws const arraytypes = ( diff --git a/NDTensors/src/lib/BlockSparseArrays/src/BlockArraysExtensions/BlockArraysExtensions.jl b/NDTensors/src/lib/BlockSparseArrays/src/BlockArraysExtensions/BlockArraysExtensions.jl index 98d58c1050..c57906fdac 100644 --- a/NDTensors/src/lib/BlockSparseArrays/src/BlockArraysExtensions/BlockArraysExtensions.jl +++ b/NDTensors/src/lib/BlockSparseArrays/src/BlockArraysExtensions/BlockArraysExtensions.jl @@ -581,7 +581,7 @@ function view!(a::AbstractArray{<:Any,N}, index::Vararg{BlockIndexRange{1},N}) w end using MacroTools: @capture -using NDTensors.SparseArrayDOKs: is_getindex_expr +using NDTensors.SparseArraysBase: is_getindex_expr macro view!(expr) if !is_getindex_expr(expr) error("@view must be used with getindex syntax (as `@view! a[i,j,...]`)") diff --git a/NDTensors/src/lib/BlockSparseArrays/src/backup/qr.jl b/NDTensors/src/lib/BlockSparseArrays/src/backup/qr.jl index aac889c446..4cd4527358 100644 --- a/NDTensors/src/lib/BlockSparseArrays/src/backup/qr.jl +++ b/NDTensors/src/lib/BlockSparseArrays/src/backup/qr.jl @@ -1,4 +1,4 @@ -using ...SparseArrayDOKs: SparseArrayDOK +using ...SparseArraysBase: SparseArrayDOK # Check if the matrix has 1 or fewer entries # per row/column. diff --git a/NDTensors/src/lib/BlockSparseArrays/src/blocksparsearray/blocksparsearray.jl b/NDTensors/src/lib/BlockSparseArrays/src/blocksparsearray/blocksparsearray.jl index 24de544dc1..19de9fd0ab 100644 --- a/NDTensors/src/lib/BlockSparseArrays/src/blocksparsearray/blocksparsearray.jl +++ b/NDTensors/src/lib/BlockSparseArrays/src/blocksparsearray/blocksparsearray.jl @@ -1,6 +1,6 @@ using BlockArrays: BlockArrays, Block, BlockedUnitRange, blockedrange, blocklength using Dictionaries: Dictionary -using ..SparseArrayDOKs: SparseArrayDOK +using ..SparseArraysBase: SparseArrayDOK # TODO: Delete this. ## using BlockArrays: blocks diff --git a/NDTensors/src/lib/BlockSparseArrays/src/blocksparsearray/defaults.jl b/NDTensors/src/lib/BlockSparseArrays/src/blocksparsearray/defaults.jl index 119b07cfc6..ab126aaa15 100644 --- a/NDTensors/src/lib/BlockSparseArrays/src/blocksparsearray/defaults.jl +++ b/NDTensors/src/lib/BlockSparseArrays/src/blocksparsearray/defaults.jl @@ -1,6 +1,6 @@ using BlockArrays: Block using Dictionaries: Dictionary -using ..SparseArrayDOKs: SparseArrayDOK +using ..SparseArraysBase: SparseArrayDOK # Construct the sparse structure storing the blocks function default_blockdata( diff --git a/NDTensors/src/lib/BlockSparseArrays/test/test_basics.jl b/NDTensors/src/lib/BlockSparseArrays/test/test_basics.jl index fe4ca22332..13eda130c2 100644 --- a/NDTensors/src/lib/BlockSparseArrays/test/test_basics.jl +++ b/NDTensors/src/lib/BlockSparseArrays/test/test_basics.jl @@ -31,7 +31,7 @@ using NDTensors.BlockSparseArrays: view! using NDTensors.GPUArraysCoreExtensions: cpu using NDTensors.SparseArraysBase: stored_length -using NDTensors.SparseArrayDOKs: SparseArrayDOK, SparseMatrixDOK, SparseVectorDOK +using NDTensors.SparseArraysBase: SparseArrayDOK, SparseMatrixDOK, SparseVectorDOK using NDTensors.TensorAlgebra: contract using Test: @test, @test_broken, @test_throws, @testset, @inferred include("TestBlockSparseArraysUtils.jl") diff --git a/NDTensors/src/lib/DiagonalArrays/src/diagonalarray/diagonalarray.jl b/NDTensors/src/lib/DiagonalArrays/src/diagonalarray/diagonalarray.jl index c8ab3c1348..6f3fc95ff3 100644 --- a/NDTensors/src/lib/DiagonalArrays/src/diagonalarray/diagonalarray.jl +++ b/NDTensors/src/lib/DiagonalArrays/src/diagonalarray/diagonalarray.jl @@ -1,6 +1,6 @@ using ..SparseArraysBase: Zero, getindex_zero_function -# TODO: Put into `DiagonalArraysSparseArrayDOKsExt`? -using ..SparseArrayDOKs: SparseArrayDOKs, SparseArrayDOK +# TODO: Put into `DiagonalArraysSparseArraysBaseExt`? +using ..SparseArraysBase: SparseArraysBase, SparseArrayDOK struct DiagonalArray{T,N,Diag<:AbstractVector{T},Zero} <: AbstractDiagonalArray{T,N} diag::Diag @@ -94,7 +94,7 @@ SparseArraysBase.sparse_storage(a::DiagonalArray) = a.diag # `SparseArraysBase` # Defines similar when the output can't be `DiagonalArray`, # such as in `reshape`. -# TODO: Put into `DiagonalArraysSparseArrayDOKsExt`? +# TODO: Put into `DiagonalArraysSparseArraysBaseExt`? # TODO: Special case 2D to output `SparseMatrixCSC`? function SparseArraysBase.sparse_similar( a::DiagonalArray, elt::Type, dims::Tuple{Vararg{Int}} diff --git a/NDTensors/src/lib/DiagonalArrays/test/runtests.jl b/NDTensors/src/lib/DiagonalArrays/test/runtests.jl index ed6a0065d7..af439730e9 100644 --- a/NDTensors/src/lib/DiagonalArrays/test/runtests.jl +++ b/NDTensors/src/lib/DiagonalArrays/test/runtests.jl @@ -1,7 +1,7 @@ @eval module $(gensym()) using Test: @test, @testset, @test_broken using NDTensors.DiagonalArrays: DiagonalArrays, DiagonalArray, DiagonalMatrix, diaglength -using NDTensors.SparseArrayDOKs: SparseArrayDOK +using NDTensors.SparseArraysBase: SparseArrayDOK using NDTensors.SparseArraysBase: stored_length @testset "Test NDTensors.DiagonalArrays" begin @testset "README" begin diff --git a/NDTensors/src/lib/NamedDimsArrays/test/test_NamedDimsArraysSparseArrayInterfaceExt.jl b/NDTensors/src/lib/NamedDimsArrays/test/test_NamedDimsArraysSparseArraysBaseExt.jl similarity index 100% rename from NDTensors/src/lib/NamedDimsArrays/test/test_NamedDimsArraysSparseArrayInterfaceExt.jl rename to NDTensors/src/lib/NamedDimsArrays/test/test_NamedDimsArraysSparseArraysBaseExt.jl diff --git a/NDTensors/src/lib/SparseArrayDOKs/.JuliaFormatter.toml b/NDTensors/src/lib/SparseArrayDOKs/.JuliaFormatter.toml deleted file mode 100644 index 08f664cdb9..0000000000 --- a/NDTensors/src/lib/SparseArrayDOKs/.JuliaFormatter.toml +++ /dev/null @@ -1,2 +0,0 @@ -style = "blue" -indent = 2 diff --git a/NDTensors/src/lib/SparseArrayDOKs/src/SparseArrayDOKs.jl b/NDTensors/src/lib/SparseArrayDOKs/src/SparseArrayDOKs.jl deleted file mode 100644 index 24b10cbc0c..0000000000 --- a/NDTensors/src/lib/SparseArrayDOKs/src/SparseArrayDOKs.jl +++ /dev/null @@ -1,7 +0,0 @@ -module SparseArrayDOKs -include("defaults.jl") -include("sparsearraydok.jl") -include("sparsematrixdok.jl") -include("sparsevectordok.jl") -include("arraylayouts.jl") -end diff --git a/NDTensors/src/lib/SparseArrayDOKs/test/Project.toml b/NDTensors/src/lib/SparseArrayDOKs/test/Project.toml deleted file mode 100644 index ade2efc435..0000000000 --- a/NDTensors/src/lib/SparseArrayDOKs/test/Project.toml +++ /dev/null @@ -1,3 +0,0 @@ -[deps] -Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4" -NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" diff --git a/NDTensors/src/lib/SparseArraysBase/src/SparseArraysBase.jl b/NDTensors/src/lib/SparseArraysBase/src/SparseArraysBase.jl index b6bb1b4736..0a9ff4fe4a 100644 --- a/NDTensors/src/lib/SparseArraysBase/src/SparseArraysBase.jl +++ b/NDTensors/src/lib/SparseArraysBase/src/SparseArraysBase.jl @@ -28,4 +28,9 @@ include("abstractsparsearray/convert.jl") include("abstractsparsearray/cat.jl") include("abstractsparsearray/SparseArraysBaseSparseArraysExt.jl") include("abstractsparsearray/SparseArraysBaseLinearAlgebraExt.jl") +include("sparsearraydok/defaults.jl") +include("sparsearraydok/sparsearraydok.jl") +include("sparsearraydok/sparsematrixdok.jl") +include("sparsearraydok/sparsevectordok.jl") +include("sparsearraydok/arraylayouts.jl") end diff --git a/NDTensors/src/lib/SparseArrayDOKs/src/arraylayouts.jl b/NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/arraylayouts.jl similarity index 100% rename from NDTensors/src/lib/SparseArrayDOKs/src/arraylayouts.jl rename to NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/arraylayouts.jl diff --git a/NDTensors/src/lib/SparseArrayDOKs/src/defaults.jl b/NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/defaults.jl similarity index 100% rename from NDTensors/src/lib/SparseArrayDOKs/src/defaults.jl rename to NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/defaults.jl diff --git a/NDTensors/src/lib/SparseArrayDOKs/src/sparsearraydok.jl b/NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/sparsearraydok.jl similarity index 100% rename from NDTensors/src/lib/SparseArrayDOKs/src/sparsearraydok.jl rename to NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/sparsearraydok.jl diff --git a/NDTensors/src/lib/SparseArrayDOKs/src/sparsematrixdok.jl b/NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/sparsematrixdok.jl similarity index 100% rename from NDTensors/src/lib/SparseArrayDOKs/src/sparsematrixdok.jl rename to NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/sparsematrixdok.jl diff --git a/NDTensors/src/lib/SparseArrayDOKs/src/sparsevectordok.jl b/NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/sparsevectordok.jl similarity index 100% rename from NDTensors/src/lib/SparseArrayDOKs/src/sparsevectordok.jl rename to NDTensors/src/lib/SparseArraysBase/src/sparsearraydok/sparsevectordok.jl diff --git a/NDTensors/src/lib/SparseArraysBase/test/Project.toml b/NDTensors/src/lib/SparseArraysBase/test/Project.toml index 3d6b1d6bc8..d674f61e4e 100644 --- a/NDTensors/src/lib/SparseArraysBase/test/Project.toml +++ b/NDTensors/src/lib/SparseArraysBase/test/Project.toml @@ -1,6 +1,7 @@ [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" +Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4" NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/NDTensors/src/lib/SparseArraysBase/test/runtests.jl b/NDTensors/src/lib/SparseArraysBase/test/runtests.jl index de8fc18fc6..40340f5eaa 100644 --- a/NDTensors/src/lib/SparseArraysBase/test/runtests.jl +++ b/NDTensors/src/lib/SparseArraysBase/test/runtests.jl @@ -1,5 +1,5 @@ @eval module $(gensym()) -for filename in ["abstractsparsearray", "array", "diagonalarray"] +for filename in ["sparsearraydok", "abstractsparsearray", "array", "diagonalarray"] include("test_$filename.jl") end end diff --git a/NDTensors/src/lib/SparseArrayDOKs/test/runtests.jl b/NDTensors/src/lib/SparseArraysBase/test/test_sparsearraydok.jl similarity index 95% rename from NDTensors/src/lib/SparseArrayDOKs/test/runtests.jl rename to NDTensors/src/lib/SparseArraysBase/test/test_sparsearraydok.jl index 25a48524bd..92afb068bc 100644 --- a/NDTensors/src/lib/SparseArrayDOKs/test/runtests.jl +++ b/NDTensors/src/lib/SparseArraysBase/test/test_sparsearraydok.jl @@ -7,8 +7,8 @@ using Dictionaries: Dictionary using Test: @test, @testset, @test_broken -using NDTensors.SparseArrayDOKs: - SparseArrayDOKs, SparseArrayDOK, SparseMatrixDOK, @maybe_grow +using NDTensors.SparseArraysBase: + SparseArraysBase, SparseArrayDOK, SparseMatrixDOK, @maybe_grow using NDTensors.SparseArraysBase: storage_indices, stored_length using SparseArrays: SparseMatrixCSC, nnz @testset "SparseArrayDOK (eltype=$elt)" for elt in @@ -98,7 +98,7 @@ using SparseArrays: SparseMatrixCSC, nnz end @testset "Maybe Grow Feature" begin a = SparseArrayDOK{elt,2}((0, 0)) - SparseArrayDOKs.setindex_maybe_grow!(a, 230, 2, 3) + SparseArraysBase.setindex_maybe_grow!(a, 230, 2, 3) @test size(a) == (2, 3) @test a[2, 3] == 230 # Test @maybe_grow macro diff --git a/NDTensors/test/Project.toml b/NDTensors/test/Project.toml index 5393f6b3f5..79a4eabfd4 100644 --- a/NDTensors/test/Project.toml +++ b/NDTensors/test/Project.toml @@ -1,5 +1,6 @@ [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" diff --git a/NDTensors/test/lib/runtests.jl b/NDTensors/test/lib/runtests.jl index 71bf0d46b7..d15a163960 100644 --- a/NDTensors/test/lib/runtests.jl +++ b/NDTensors/test/lib/runtests.jl @@ -18,7 +18,7 @@ using Test: @testset "NestedPermutedDimsArrays", "SmallVectors", "SortedSets", - "SparseArrayDOKs", + "SparseArraysBase", "SymmetrySectors", "TagSets", "TensorAlgebra",