ACEsuit / ACEbase.jl

Shared definitions for ACEsuit packages
0 stars 3 forks source link

read_dict not defined for `ACE_VectorOfNumber` #7

Open CheukHinHoJerry opened 1 year ago

CheukHinHoJerry commented 1 year ago

When reading some models generated from old code I have to explicitly import the following function and extend read_dict:

function ACEbase.FIO.read_dict(::Val{:ACE_VectorOfNumber}, D::Dict)
   T = read_dict(D["T"])
   A = T.(D["real"])
   if T <: Complex
      A[:] .+= im .* D["imag"]
   end
   return A
end

Maybe a warning should be prompted together with this work around for people who do not aware this or is it a problem from my end?