Skip to content

Commit

Permalink
Merge pull request #29 from frankwswang/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
frankwswang authored Oct 26, 2021
2 parents 620a8f6 + d41ef68 commit 63d6415
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/Basis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ function ijkIndex(b::FloatingGTBasisFuncs)
end

"""
centerOf(bf::FloatingGTBasisFuncs) -> Array{<:Real, 1}
Return the center coordinate of the input `FloatingGTBasisFuncs`.
Expand Down
11 changes: 0 additions & 11 deletions src/Tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -436,17 +436,6 @@ function flatten(c::Array)
[(c2...)...]
end

function flatten2(c::Array)
c2 = map( x->(x isa Tuple ? Any[i for i in x] : x), c )
vcat(c2...)
end

function flatten3(c::Array)
head = c[1] isa Union{Array, Tuple}
c2 = map( x->(x isa Tuple ? Any[i for i in x] : x), c )
vcat(c2...)
end

function flatten(c::Tuple)
c2 = map( x->(x isa Union{Array, Tuple} ? x : [x]), c )
((c2...)...,)
Expand Down
1 change: 1 addition & 0 deletions test/unit-tests/Overload-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ using Suppressor: @capture_out
@test axes(pb1) == ()

@test getindex(gf1) == gf1[] == gf1[begin] == gf1[end] == (gf1.param |> collect)
@test getindex(bf1) == bf1[] == bf1[begin] == bf1[end] == (bf1.gauss |> collect)
bfm11 = Quiqbox.BasisFuncMix([bf1, bf2, bf1])
@test getindex(bfm11) == bfm11[] == bfm11[begin] == bfm11[end] ==
[bf1.gauss[1], bf2.gauss...]
Expand Down
14 changes: 13 additions & 1 deletion test/unit-tests/Tools-test.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using Quiqbox: tryIncluding, @compareLength, hasBoolRelation, markUnique, flatten,
alignSignedNum, symbolReplace, splitTerm, groupedSort, mapPermute
alignSignedNum, symbolReplace, splitTerm, groupedSort, mapPermute, Pf, itself
using Quiqbox
using Symbolics
using Suppressor: @capture_out
Expand Down Expand Up @@ -95,4 +95,16 @@ using Suppressor: @capture_out
@test bl1
@test bl2
@test bl3

# struct Pf
@test Pf(-1.5, abs)(-2) == -3.0
@test Pf(-1.0, Pf(-1.5, abs))(-2) == 3.0
@test Pf(1.5, Val(:abs))(-2) == 3.0
@test Pf(-1.0, Val(Pf{-1.5, :abs}))(-2) == 3.0
@test typeof(Pf(-1.5, abs))(-2) == -3.0

@test Pf(-1.0, Pf(-1.5, itself))(-2) == -3.0
@test Pf(1.5, Val(:itself))(-2) == -3.0
@test Pf(-1.0, Val(Pf{-1.5, :itself}))(-2) == -3.0
@test typeof(Pf(-1.5, itself))(-2) == 3.0
end

2 comments on commit 63d6415

@frankwswang
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/47506

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.0 -m "<description of version>" 63d6415a5466f02edb50a2ba0242b0932fe85259
git push origin v0.2.0

Please sign in to comment.