Skip to content

Commit 2ebc722

Browse files
authored
Remove DerivableInterfaces dependency (#103)
1 parent 2c45ad2 commit 2ebc722

5 files changed

Lines changed: 7 additions & 26 deletions

File tree

Project.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name = "ITensorBase"
22
uuid = "4795dd04-0d67-49bb-8f44-b89c448a1dc7"
33
authors = ["ITensor developers <support@itensor.org> and contributors"]
4-
version = "0.4.2"
4+
version = "0.4.3"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
88
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
9-
DerivableInterfaces = "6c5e35bf-e59e-4898-b73c-732dcc4ba65f"
109
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
1110
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1211
MapBroadcast = "ebd9b9da-f48d-417c-9660-449667d60261"
@@ -20,11 +19,10 @@ VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"
2019
[compat]
2120
Accessors = "0.1.39"
2221
ConstructionBase = "1.6.0"
23-
DerivableInterfaces = "0.5"
2422
FillArrays = "1.13"
2523
LinearAlgebra = "1.10"
2624
MapBroadcast = "0.1.5"
27-
NamedDimsArrays = "0.11.1"
25+
NamedDimsArrays = "0.11.1, 0.12"
2826
Random = "1.10"
2927
TensorAlgebra = "0.3, 0.4, 0.5, 0.6"
3028
UnallocatedArrays = "0.1.1"

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ ITensorBase = {path = ".."}
1111
Documenter = "1"
1212
ITensorBase = "0.4"
1313
Literate = "2"
14-
NamedDimsArrays = "0.11"
14+
NamedDimsArrays = "0.11, 0.12"

examples/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ ITensorBase = {path = ".."}
99
[compat]
1010
ITensorBase = "0.4"
1111
LinearAlgebra = "1.10"
12-
NamedDimsArrays = "0.11"
12+
NamedDimsArrays = "0.11, 0.12"

src/abstractitensor.jl

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ function allocate!(a::AbstractITensor)
3434
return a
3535
end
3636

37-
using DerivableInterfaces: @derive, @interface, AbstractArrayInterface
38-
39-
abstract type AbstractAllocatableArrayInterface{N} <: AbstractArrayInterface{N} end
40-
struct AllocatableArrayInterface{N} <: AbstractAllocatableArrayInterface{N} end
41-
AllocatableArrayInterface{M}(::Val{N}) where {M, N} = AllocatableArrayInterface{N}()
42-
AllocatableArrayInterface(::Val{N}) where {N} = AllocatableArrayInterface{N}()
43-
AllocatableArrayInterface() = AllocatableArrayInterface{Any}()
44-
4537
unallocatable(a::AbstractITensor) = NamedDimsArray(a)
4638

4739
function setindex_allocatable!(a::AbstractArray, value, I...)
@@ -52,24 +44,15 @@ function setindex_allocatable!(a::AbstractArray, value, I...)
5244
end
5345

5446
# TODO: Combine these by using `Base.to_indices`.
55-
@interface ::AbstractAllocatableArrayInterface function Base.setindex!(
56-
a::AbstractArray, value, I::Int...
57-
)
47+
function Base.setindex!(a::AbstractITensor, value, I::Int...)
5848
setindex_allocatable!(a, value, I...)
5949
return a
6050
end
61-
@interface ::AbstractAllocatableArrayInterface function Base.setindex!(
62-
a::AbstractArray, value, I::AbstractNamedInteger...
63-
)
51+
function Base.setindex!(a::AbstractITensor, value, I::AbstractNamedInteger...)
6452
setindex_allocatable!(a, value, I...)
6553
return a
6654
end
6755

68-
@derive AllocatableArrayInterface() (T = AbstractITensor,) begin
69-
Base.setindex!(::T, ::Any, ::Int...)
70-
Base.setindex!(::T, ::Any, ::AbstractNamedInteger...)
71-
end
72-
7356
mutable struct ITensor <: AbstractITensor
7457
parent::AbstractArray
7558
inds

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ITensorBase = {path = ".."}
1414
Aqua = "0.8.9"
1515
ITensorBase = "0.4"
1616
LinearAlgebra = "1.10"
17-
NamedDimsArrays = "0.11"
17+
NamedDimsArrays = "0.11, 0.12"
1818
SafeTestsets = "0.1"
1919
Suppressor = "0.2"
2020
Test = "1.10"

0 commit comments

Comments
 (0)