We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When running a function that uses ;; to concatenate, like:
;;
RF_hard(B1, T, sys::Scanner; G=[0,0,0]) = begin ζ = sum(G) / sys.Smax EX = Sequence([ Grad(G[1],T,ζ); #Gx Grad(G[2],T,ζ); #Gy Grad(G[3],T,ζ);;], #Gz [RF(B1,T,0,ζ)] #RF ) EX end
Julia 1.7.3 throws an error:
julia> PulseDesigner.RF_hard(1.,1.,Scanner()) ERROR: MethodError: no method matching size(::Grad, ::Int64) Closest candidates are: size(::Union{LinearAlgebra.QR, LinearAlgebra.QRCompactWY, LinearAlgebra.QRPivoted}, ::Integer) at /opt/julia-1.7.3/share/julia/stdlib/v1.7/LinearAlgebra/src/qr.jl:566 size(::Union{LinearAlgebra.Cholesky, LinearAlgebra.CholeskyPivoted}, ::Integer) at /opt/julia-1.7.3/share/julia/stdlib/v1.7/LinearAlgebra/src/cholesky.jl:495 size(::Union{LinearOperators.AdjointLinearOperator, LinearOperators.TransposeLinearOperator}, ::Int64) at ~/.julia/packages/LinearOperators/58FwN/src/adjtrans.jl:63 ... Stacktrace: [1] _typed_hvncat_dims(#unused#::Type{Grad}, dims::Tuple{Int64, Int64}, row_first::Bool, as::Tuple{Grad, Grad, Grad}) @ Base ./abstractarray.jl:2328 [2] _typed_hvncat @ ./abstractarray.jl:2304 [inlined] [3] _hvncat @ ./abstractarray.jl:2133 [inlined] [4] hvncat @ ./abstractarray.jl:2129 [inlined] [5] RF_hard(B1::Float64, T::Float64, sys::Scanner; G::Vector{Int64}) @ Koma.PulseDesigner ~/Documents/Koma.jl/src/sequences/PulseDesigner.jl:11 [6] RF_hard(B1::Float64, T::Float64, sys::Scanner) @ Koma.PulseDesigner ~/Documents/Koma.jl/src/sequences/PulseDesigner.jl:10 [7] top-level scope @ REPL[3]:1
The text was updated successfully, but these errors were encountered:
Defining the size of a Grad and RF as 1 fixes the problem:
Grad
RF
size(g::Grad, i::Int64) = 1 #In src/datatypes/sequence/Grad.jl size(r::RF, i::Int64) = 1 #In src/datatypes/sequence/RF.jl
Examples:
julia> [RF(1,1);RF(1,1);;] 2×1 Matrix{RF}: RF(1.0e6 uT, 1000.0 ms, 0.0 Hz) RF(1.0e6 uT, 1000.0 ms, 0.0 Hz) julia> [Grad(1,1);Grad(1,1);Grad(1,1);;] 3×1 Matrix{Grad}: Grad(1000.0 mT, 1000.0 ms) Grad(1000.0 mT, 1000.0 ms) Grad(1000.0 mT, 1000.0 ms)
Committing soon.
Sorry, something went wrong.
Fixed in aaf1c6e.
No branches or pull requests
When running a function that uses
;;
to concatenate, like:Julia 1.7.3 throws an error:
The text was updated successfully, but these errors were encountered: