Skip to content

Commit

Permalink
Change over from Derive.jl to DerivableInterfaces.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Jan 10, 2025
1 parent 43fc9d6 commit b68fac9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
10 changes: 3 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
name = "DiagonalArrays"
uuid = "74fd4be6-21e2-4f6f-823a-4360d37c7a77"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.2.0"
version = "0.2.1"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
BroadcastMapConversion = "4a4adec5-520f-4750-bb37-d5e66b4ddeb2"
Derive = "a07dfc7f-7d04-4eb5-84cc-a97f051f655a"
DerivableInterfaces = "6c5e35bf-e59e-4898-b73c-732dcc4ba65f"
SparseArraysBase = "0d5efcca-f356-4864-8770-e1ed8d78f208"
TypeParameterAccessors = "7e5a90cf-f82e-492e-a09b-e3e26432c138"

[compat]
ArrayLayouts = "1.10.4"
BroadcastMapConversion = "0.1"
Derive = "0.3.6"
DerivableInterfaces = "0.3.7"
SparseArraysBase = "0.2.1"
TypeParameterAccessors = "0.2"
julia = "1.10"
4 changes: 0 additions & 4 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
[deps]
BroadcastMapConversion = "4a4adec5-520f-4750-bb37-d5e66b4ddeb2"
DiagonalArrays = "74fd4be6-21e2-4f6f-823a-4360d37c7a77"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
NestedPermutedDimsArrays = "2c2a8ec4-3cfc-4276-aa3e-1307b4294e58"
SparseArraysBase = "0d5efcca-f356-4864-8770-e1ed8d78f208"
TypeParameterAccessors = "7e5a90cf-f82e-492e-a09b-e3e26432c138"
12 changes: 8 additions & 4 deletions src/abstractdiagonalarray/diagonalarraydiaginterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

diagview(a::AbstractDiagonalArray) = throw(MethodError(diagview, Tuple{typeof(a)}))

using Derive: Derive, @interface
using DerivableInterfaces: DerivableInterfaces, @interface
using SparseArraysBase:
SparseArraysBase, AbstractSparseArrayInterface, AbstractSparseArrayStyle ## , StorageIndex, StorageIndices

abstract type AbstractDiagonalArrayInterface <: AbstractSparseArrayInterface end

struct DiagonalArrayInterface <: AbstractDiagonalArrayInterface end

Derive.arraytype(::AbstractDiagonalArrayInterface, elt::Type) = DiagonalArray{elt}
Derive.interface(::Type{<:AbstractDiagonalArray}) = DiagonalArrayInterface()
function DerivableInterfaces.arraytype(::AbstractDiagonalArrayInterface, elt::Type)
return DiagonalArray{elt}
end
DerivableInterfaces.interface(::Type{<:AbstractDiagonalArray}) = DiagonalArrayInterface()

abstract type AbstractDiagonalArrayStyle{N} <: AbstractSparseArrayStyle{N} end

Derive.interface(::Type{<:AbstractDiagonalArrayStyle}) = DiagonalArrayInterface()
function DerivableInterfaces.interface(::Type{<:AbstractDiagonalArrayStyle})
return DiagonalArrayInterface()
end

struct DiagonalArrayStyle{N} <: AbstractDiagonalArrayStyle{N} end

Expand Down

0 comments on commit b68fac9

Please sign in to comment.