Skip to content

Commit

Permalink
Fix CrystalNet(::UnderlyingNets)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liozou committed Oct 18, 2024
1 parent 28c1808 commit fea3af2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -908,15 +908,15 @@ function CrystalNet(x::UnderlyingNets)
CrystalNet{0}(Cell(), Options(; error="Empty UnderlyingNets cannot be converted to a CrystalNet."))
end
if length(x.D1) == 1
return x.D1[1][2][1]
return first(first(first(x.D1)))
end
end
if length(x.D2) == 1 && isempty(x.D1)
return x.D2[1][2][1]
return first(first(first(x.D2)))
end
end
if length(x.D3) == 1 && isempty(x.D2) && isempty(x.D1)
return x.D3[1][2][1]
return first(first(first(x.D3)))
end
CrystalNet{0}(Cell(), Options(; error="UnderlyingNets contain multiple nets, cannot be converted to a single CrystalNet."))
end
Expand Down

0 comments on commit fea3af2

Please sign in to comment.