Skip to content

Commit

Permalink
Merge pull request #29 from ACEsuit/fix_specnlm2spec1p
Browse files Browse the repository at this point in the history
quick fix for specnlm2spec1p
  • Loading branch information
zhanglw0521 authored Apr 11, 2024
2 parents 0eb5de5 + 7bf6e3a commit a7402d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,15 @@ specnlm2spec1p(spec_nlm)
From a list of AA specifications to all A specifications needed
"""
function specnlm2spec1p(spec_nlm)
spec1p = union(spec_nlm...)
# spec1p = union(spec_nlm...) # oringinal implementation which leads to StackOverflowError when input vector is too long
spec1p = []
for spec_nlm_i in spec_nlm
push!(spec1p, spec_nlm_i...)
end
unique!(spec1p)
lmax = [ spec1p[i].l for i = 1:length(spec1p) ] |> maximum
nmax = [ spec1p[i].n for i = 1:length(spec1p) ] |> maximum
return spec1p, lmax, nmax + 1
return identity.(spec1p), lmax, nmax + 1
end

nset(spec1p) = [ (n=spec.n,) for spec in spec1p]
Expand Down

0 comments on commit a7402d7

Please sign in to comment.