Skip to content

Commit

Permalink
Merge pull request #207 from SciML/AlCap23-patch-5
Browse files Browse the repository at this point in the history
unique! issues
  • Loading branch information
AlCap23 authored May 4, 2021
2 parents 3973bd9 + f159fb5 commit 9e8ad7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DataDrivenDiffEq"
uuid = "2445eb08-9709-466a-b3fc-47e12bd697a2"
authors = ["Julius Martensen <[email protected]>"]
version = "0.5.6"
version = "0.5.7"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
8 changes: 4 additions & 4 deletions src/basis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function update!(b::Basis, eval_expression = false)
return
end

function unique(b::AbstractArray{Num}, simplify_eqs = false)
function unique(b::AbstractArray{Num}, simplify_eqs::Bool)
b = simplify_eqs ? simplify.(b) : b
returns = ones(Bool, size(b)...)
N = maximum(eachindex(b))
Expand All @@ -156,7 +156,7 @@ function unique(b::AbstractArray{Num}, simplify_eqs = false)
return b[returns]
end

function Base.unique!(b::AbstractArray, simplify_eqs = false)
function Base.unique!(b::AbstractArray, simplify_eqs::Bool)
bs = simplify_eqs ? simplify.(b) : b
removes = zeros(Bool, size(bs)...)
N = maximum(eachindex(bs))
Expand All @@ -166,7 +166,7 @@ function Base.unique!(b::AbstractArray, simplify_eqs = false)
deleteat!(b, removes)
end

function unique(b::AbstractArray{Equation}, simplify_eqs = false)
function unique(b::AbstractArray{Equation}, simplify_eqs::Bool)
b = simplify_eqs ? simplify.(b) : b
returns = ones(Bool, size(b)...)
N = maximum(eachindex(b))
Expand All @@ -176,7 +176,7 @@ function unique(b::AbstractArray{Equation}, simplify_eqs = false)
return b[returns]
end

function Base.unique!(b::AbstractArray{Equation}, simplify_eqs = false)
function Base.unique!(b::AbstractArray{Equation}, simplify_eqs::Bool)
bs = [bi.rhs for bi in b]
bs = simplify_eqs ? simplify.(bs) : bs
removes = zeros(Bool, size(bs)...)
Expand Down

0 comments on commit 9e8ad7f

Please sign in to comment.