Skip to content

Commit 2921418

Browse files
committed
fix: circular dep due to Functors
1 parent 7adf959 commit 2921418

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

Project.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name = "ComponentArrays"
22
uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
33
authors = ["Jonnie Diegelman <[email protected]>"]
4-
version = "0.15.18"
4+
version = "0.15.19"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
88
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
9+
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
910
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1011
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
1112
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -14,7 +15,6 @@ StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
1415

1516
[weakdeps]
1617
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
17-
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
1818
GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
1919
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
2020
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
@@ -25,7 +25,6 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2525

2626
[extensions]
2727
ComponentArraysAdaptExt = "Adapt"
28-
ComponentArraysConstructionBaseExt = "ConstructionBase"
2928
ComponentArraysGPUArraysExt = "GPUArrays"
3029
ComponentArraysOptimisersExt = "Optimisers"
3130
ComponentArraysRecursiveArrayToolsExt = "RecursiveArrayTools"

ext/ComponentArraysConstructionBaseExt.jl

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/ComponentArrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ module ComponentArrays
22

33
import ChainRulesCore
44
import StaticArrayInterface, ArrayInterface, Functors
5+
import ConstructionBase
56

67
using LinearAlgebra
78
using StaticArraysCore: StaticArray, SArray, SVector, SMatrix
89

910
const FlatIdx = Union{Integer, CartesianIndex, CartesianIndices, AbstractArray{<:Integer}}
1011
const FlatOrColonIdx = Union{FlatIdx, Colon}
1112

12-
1313
include("utils.jl")
1414
export fastindices # Deprecated
1515

src/componentarray.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ ComponentVector{T}(::UndefInitializer, ax) where {T} = ComponentArray{T}(undef,
8989
ComponentVector(data::AbstractVector, ax) = ComponentArray(data, ax)
9090
ComponentVector(data::AbstractArray, ax) = throw(DimensionMismatch("A `ComponentVector` must be initialized with a 1-dimensional array. This array is $(ndims(data))-dimensional."))
9191

92+
ConstructionBase.setproperties(x::ComponentVector, patch::NamedTuple) = ComponentVector(x; patch...)
93+
9294
# Add new fields to component Vector
9395
function ComponentArray(x::ComponentVector; kwargs...)
9496
return foldl((x1, kwarg) -> _maybe_add_field(x1, kwarg), (kwargs...,); init=x)

0 commit comments

Comments
 (0)