Skip to content

Commit

Permalink
Remove DuplicateVector (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrhill authored Oct 21, 2024
1 parent ececbfd commit f766b0c
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 55 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Version `v0.6.8`

* ![Feature][badge-feature] Support `clamp` and `clamp!` ([#208])
* ![Maintenance][badge-maintenance] Remove internal set type `DuplicateVector` ([#209])

## Version `v0.6.7`

Expand Down Expand Up @@ -84,6 +85,7 @@
[badge-maintenance]: https://img.shields.io/badge/maintenance-gray.svg
[badge-docs]: https://img.shields.io/badge/docs-orange.svg

[#209]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/209
[#208]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/208
[#205]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/205
[#204]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/204
Expand Down
1 change: 0 additions & 1 deletion src/SparseConnectivityTracer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using FillArrays: Fill

using DocStringExtensions: DocStringExtensions, TYPEDEF, TYPEDFIELDS

include("settypes/duplicatevector.jl")
include("settypes/recursiveset.jl")
include("settypes/sortedvector.jl")

Expand Down
2 changes: 1 addition & 1 deletion src/patterns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function union_product!(
end

# Some custom set types don't support `push!`
for S in (:DuplicateVector, :SortedVector, :RecursiveSet)
for S in (:SortedVector, :RecursiveSet)
@eval function union_product!(
hessian::$S{Tuple{I,I}}, gradient_x::$S{I}, gradient_y::$S{I}
) where {I<:Integer}
Expand Down
42 changes: 0 additions & 42 deletions src/settypes/duplicatevector.jl

This file was deleted.

1 change: 0 additions & 1 deletion test/brusselator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ using ADTypes
using ADTypes: AbstractSparsityDetector
using ReferenceTests
using SparseConnectivityTracer
using SparseConnectivityTracer: DuplicateVector, RecursiveSet, SortedVector
using SparseConnectivityTracerBenchmarks.ODE: Brusselator!
using Test

Expand Down
1 change: 0 additions & 1 deletion test/flux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ using ADTypes: AbstractSparsityDetector
using Flux: Conv, relu
using ReferenceTests
using SparseConnectivityTracer
using SparseConnectivityTracer: DuplicateVector, RecursiveSet, SortedVector
using Test

# Load definitions of GRADIENT_TRACERS, GRADIENT_PATTERNS, HESSIAN_TRACERS and HESSIAN_PATTERNS
Expand Down
6 changes: 2 additions & 4 deletions test/settypes/correctness.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using SparseConnectivityTracer
using SparseConnectivityTracer: DuplicateVector, RecursiveSet, SortedVector, product
using SparseConnectivityTracer: RecursiveSet, SortedVector, product
using Test

@testset "$S" for S in (
BitSet, Set{Int}, DuplicateVector{Int}, RecursiveSet{Int}, SortedVector{Int}
)
@testset "$S" for S in (BitSet, Set{Int}, RecursiveSet{Int}, SortedVector{Int})
x = S.(1:10)
y = (x[1] x[3]) (x[3] ((x[5] x[7]) x[1]))

Expand Down
6 changes: 1 addition & 5 deletions test/tracers_definitions.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using SparseConnectivityTracer: AbstractTracer, GradientTracer, HessianTracer, Dual
using SparseConnectivityTracer: IndexSetGradientPattern
using SparseConnectivityTracer: IndexSetHessianPattern, DictHessianPattern
using SparseConnectivityTracer: DuplicateVector, RecursiveSet, SortedVector
using SparseConnectivityTracer: RecursiveSet, SortedVector
using SparseConnectivityTracer: Shared, NotShared

GRADIENT_PATTERNS = (
IndexSetGradientPattern{Int,BitSet},
IndexSetGradientPattern{Int,Set{Int}},
IndexSetGradientPattern{Int,DuplicateVector{Int}},
IndexSetGradientPattern{Int,SortedVector{Int}},
IndexSetGradientPattern{Int,RecursiveSet{Int}},
)
Expand All @@ -19,9 +18,6 @@ HESSIAN_PATTERNS_SHARED = (
HESSIAN_PATTERNS_NOTSHARED = (
IndexSetHessianPattern{Int,BitSet,Set{Tuple{Int,Int}},NotShared},
IndexSetHessianPattern{Int,BitSet,Set{Tuple{Int,Int}},NotShared},
IndexSetHessianPattern{
Int,DuplicateVector{Int},DuplicateVector{Tuple{Int,Int}},NotShared
},
IndexSetHessianPattern{Int,SortedVector{Int},SortedVector{Tuple{Int,Int}},NotShared},
# TODO: test on RecursiveSet
DictHessianPattern{Int,BitSet,Dict{Int,BitSet},NotShared},
Expand Down

0 comments on commit f766b0c

Please sign in to comment.