Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/libAtoms/JuLIP.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Ortner committed Jul 8, 2019
2 parents 430e4c0 + 455b85d commit 2efb671
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/onebody.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ end
evaluate(V::MOneBody,sp) = V.E0[sp]

function site_energies(V::MOneBody{T}, at::Atoms) where {T}
E = zeros(T, 1, length(at))
E = zeros(T, length(at))
for i in 1:length(at)
E[i] = V(chemical_symbols(at)[i])
end
Expand All @@ -82,6 +82,8 @@ function convert_str_2_symb(D::Dict{String,T}) where {T}
return Dout
end

convert_str_2_symb(D::Dict{Symbol,T}) where {T} = D #already in the correct form

MOneBody(D::Dict{String, T}) where {T} = MOneBody(convert_str_2_symb(D["E0"]))

convert(::Val{:MOneBody}, D::Dict) = MOneBody(convert_str_2_symb(D["E0"]))
Expand Down

0 comments on commit 2efb671

Please sign in to comment.