From 783705deda38bd891ce41a3e1f991169e694b71b Mon Sep 17 00:00:00 2001 From: mattsignorelli Date: Wed, 6 Aug 2025 15:45:51 -0700 Subject: [PATCH 1/2] bump and accept array --- Project.toml | 4 ++-- src/map.jl | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index b76b23a..e4d9cc2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NonlinearNormalForm" uuid = "05e19671-dec8-4f15-984f-54eaa6ca64be" authors = ["Matt Signorelli"] -version = "0.3.1" +version = "0.3.2" [deps] DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" @@ -26,7 +26,7 @@ Reexport = "1" ReferenceFrameRotations = "3" SkewLinearAlgebra = "1" StaticArrays = "1" -TPSAInterface = "0.2.0" +TPSAInterface = "0.2.1" julia = "1.9" [extras] diff --git a/src/map.jl b/src/map.jl index 63af55f..32d3434 100644 --- a/src/map.jl +++ b/src/map.jl @@ -286,15 +286,25 @@ function $t(; init::Union{AbstractTPSAInit,Nothing}=nothing, nv::Union{Integer,Nothing}=nothing, np::Union{Integer,Nothing}=nothing, - v0::Union{AbstractVector,Nothing}=nothing, - v::Union{AbstractVector,Nothing}=nothing, + v0::Union{AbstractArray,Nothing}=nothing, + v::Union{AbstractArray,Nothing}=nothing, v_matrix::Union{AbstractMatrix,UniformScaling,Nothing}=nothing, - q::Union{Quaternion,AbstractVector,UniformScaling,Nothing}=nothing, + q::Union{Quaternion,AbstractArray,UniformScaling,Nothing}=nothing, q_map::Union{AbstractMatrix,Nothing}=nothing, s::Union{AbstractMatrix,Nothing}=nothing, spin::Union{Bool,Nothing}=nothing, stochastic::Union{Bool,Nothing}=nothing, ) + if !isnothing(v0) && !(v0 isa AbstractVector) + v0 = reshape(v0, (length(v0))) + end + if !isnothing(v) && !(v isa AbstractVector) + v = reshape(v, (length(v))) + end + if !isnothing(q) && !(q isa AbstractVector) + q = reshape(q, (4)) + end + if isnothing(init) if !isnothing(v) && TI.is_tps_type(eltype(v)) isa TI.IsTPSType init = getinit(first(v)) From b2195ff4dd3d4a7e3c0c33329d3b2c1180d279b1 Mon Sep 17 00:00:00 2001 From: mattsignorelli Date: Wed, 6 Aug 2025 15:50:16 -0700 Subject: [PATCH 2/2] fix --- src/map.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map.jl b/src/map.jl index 32d3434..c5fc13c 100644 --- a/src/map.jl +++ b/src/map.jl @@ -301,7 +301,7 @@ function $t(; if !isnothing(v) && !(v isa AbstractVector) v = reshape(v, (length(v))) end - if !isnothing(q) && !(q isa AbstractVector) + if !isnothing(q) && q isa AbstractArray && !(q isa AbstractVector) q = reshape(q, (4)) end