Skip to content

Commit f6463d4

Browse files
committed
Forgot I can’t call symbols
1 parent 140f317 commit f6463d4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/matrixmodels/matrixmodels.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ struct NoZ2Sym <: Z2Symmetry end
5757
function ACE.write_dict(z2s::Z2S) where {Z2S<:Z2Symmetry}
5858
return Dict("__id__" => string("ACEfriction_Z2Symmetry"), "z2s"=>typeof(z2s))
5959
end
60-
function ACE.read_dict(::Val{:ACEfriction_Z2Symmetry}, D::Dict) # This one includes its entire type string.
61-
return Symbol(D["z2s"])()
60+
function ACE.read_dict(::Val{:ACEfriction_Z2Symmetry}, D::Dict)
61+
z2s = getfield(ACEfriction.MatrixModels, Symbol(split(D["z2s"], ".")[end])) # This was exporting it's full type, whereas we just need the last node.
62+
return z2s()
6263
end
6364
abstract type SpeciesCoupling end
6465

0 commit comments

Comments
 (0)