-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from bionanoimaging/fix_type_tools
added new methods to similar_arr_type to deal with SubArray ReshapedA…
- Loading branch information
Showing
4 changed files
with
54 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Manifest.toml | ||
test/Manifest.toml | ||
exmaples/Manifest.toml | ||
|
||
docs/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
@testset "Test Type Tools" begin | ||
sz = (11,12) | ||
@test real_arr_type(Array{Float32,2}) == Matrix{Float32} | ||
@test complex_arr_type(Array{Float32,1}, dims=2) == Matrix{ComplexF32} | ||
@test real_arr_type(Array{Float32}, dims=2) == Matrix{Float32} | ||
@test complex_arr_type(Array{Float32}, dims=2) == Matrix{ComplexF32} | ||
@test real_arr_type(Array{ComplexF64,2}, dims=1) == Vector{Float64} | ||
@test complex_arr_type(Array{Float32,1}, Val(2)) == Matrix{ComplexF32} | ||
@test real_arr_type(Array{Float32}, Val(2)) == Matrix{Float32} | ||
@test complex_arr_type(Array{Float32}, Val(2)) == Matrix{ComplexF32} | ||
@test real_arr_type(Array{ComplexF64,2}, Val(1)) == Vector{Float64} | ||
@test complex_arr_type(Array{ComplexF64,1}) == Vector{ComplexF64} | ||
@test similar_arr_type(Array{ComplexF64,1}, dims=2, dtype=Int) == Matrix{Int} | ||
@test similar_arr_type(Array{ComplexF64}, dims=2, dtype=Int) == Matrix{Int} | ||
|
||
@test similar_arr_type(Array{ComplexF64,1}, Int, Val(2)) == Matrix{Int} | ||
@test similar_arr_type(Array{ComplexF64}, Float64, Val(2)) == Matrix{Float64} | ||
@test similar_arr_type(typeof(view(ones(10,10),2:5,2:5)), Float64, Val(1)) == Vector{Float64} | ||
@test similar_arr_type(typeof(reinterpret(Int, ones(10))), Float32, Val(2)) == Matrix{Float32} | ||
@test similar_arr_type(typeof(reshape(view(ones(25),1:25), 5,5)), Int, Val(1)) == Vector{Int} | ||
end |
7a6e941
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
Release notes:
similar_arr_type
,complex_arr_type
andreal_arr_type
have new argument order and are type stable now.7a6e941
There was a problem hiding this comment.
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/109415
Tagging
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: