Skip to content

Commit

Permalink
Use MapBroadcast.jl and DerivableInterfaces.jl (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman authored Jan 10, 2025
1 parent ebcc225 commit e5721c2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
10 changes: 5 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name = "NamedDimsArrays"
uuid = "60cbd0c0-df58-4cb7-918c-6f5607b73fde"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.3.3"
version = "0.3.4"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
BroadcastMapConversion = "4a4adec5-520f-4750-bb37-d5e66b4ddeb2"
Derive = "a07dfc7f-7d04-4eb5-84cc-a97f051f655a"
DerivableInterfaces = "6c5e35bf-e59e-4898-b73c-732dcc4ba65f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MapBroadcast = "ebd9b9da-f48d-417c-9660-449667d60261"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SimpleTraits = "699a6c99-e7fa-54fc-8d76-47d257e15c1d"
TensorAlgebra = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
Expand All @@ -24,9 +24,9 @@ NamedDimsArraysBlockArraysExt = "BlockArrays"
Adapt = "4.1.1"
ArrayLayouts = "1.11.0"
BlockArrays = "1.3.0"
BroadcastMapConversion = "0.1.2"
Derive = "0.3.6"
DerivableInterfaces = "0.3.7"
LinearAlgebra = "1.10"
MapBroadcast = "0.1.5"
Random = "1.10"
SimpleTraits = "0.9.4"
TensorAlgebra = "0.1"
Expand Down
5 changes: 1 addition & 4 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[deps]
BroadcastMapConversion = "4a4adec5-520f-4750-bb37-d5e66b4ddeb2"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
NamedDimsArrays = "60cbd0c0-df58-4cb7-918c-6f5607b73fde"
NestedPermutedDimsArrays = "2c2a8ec4-3cfc-4276-aa3e-1307b4294e58"
SparseArraysBase = "0d5efcca-f356-4864-8770-e1ed8d78f208"
TensorAlgebra = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
TypeParameterAccessors = "7e5a90cf-f82e-492e-a09b-e3e26432c138"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4 changes: 1 addition & 3 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[deps]
BroadcastMapConversion = "4a4adec5-520f-4750-bb37-d5e66b4ddeb2"
NamedDimsArrays = "60cbd0c0-df58-4cb7-918c-6f5607b73fde"
SparseArraysBase = "0d5efcca-f356-4864-8770-e1ed8d78f208"
TensorAlgebra = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
TypeParameterAccessors = "7e5a90cf-f82e-492e-a09b-e3e26432c138"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6 changes: 3 additions & 3 deletions src/abstractnameddimsarray.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Derive: Derive, @derive, AbstractArrayInterface
using DerivableInterfaces: DerivableInterfaces, @derive, AbstractArrayInterface
using TypeParameterAccessors: unspecify_type_parameters

# Some of the interface is inspired by:
Expand All @@ -16,7 +16,7 @@ abstract type AbstractNamedDimsArray{T,N} <: AbstractArray{T,N} end
const AbstractNamedDimsVector{T} = AbstractNamedDimsArray{T,1}
const AbstractNamedDimsMatrix{T} = AbstractNamedDimsArray{T,2}

Derive.interface(::Type{<:AbstractNamedDimsArray}) = NamedDimsArrayInterface()
DerivableInterfaces.interface(::Type{<:AbstractNamedDimsArray}) = NamedDimsArrayInterface()

# Output the dimension names.
nameddimsindices(a::AbstractArray) = throw(MethodError(nameddimsindices, Tuple{typeof(a)}))
Expand Down Expand Up @@ -711,7 +711,7 @@ using Base.Broadcast:
broadcasted,
check_broadcast_shape,
combine_axes
using BroadcastMapConversion: Mapped, mapped
using MapBroadcast: Mapped, mapped

abstract type AbstractNamedDimsArrayStyle{N} <: AbstractArrayStyle{N} end

Expand Down
4 changes: 0 additions & 4 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
BlockSparseArrays = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
BroadcastMapConversion = "4a4adec5-520f-4750-bb37-d5e66b4ddeb2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NamedDimsArrays = "60cbd0c0-df58-4cb7-918c-6f5607b73fde"
NestedPermutedDimsArrays = "2c2a8ec4-3cfc-4276-aa3e-1307b4294e58"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SparseArraysBase = "0d5efcca-f356-4864-8770-e1ed8d78f208"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
TensorAlgebra = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TypeParameterAccessors = "7e5a90cf-f82e-492e-a09b-e3e26432c138"

[compat]
Aqua = "0.8.9"
Expand Down

0 comments on commit e5721c2

Please sign in to comment.