Skip to content

Commit

Permalink
Fix backwards-compatibility test
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Jan 21, 2025
1 parent 536f1af commit 079510f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions avogadro/io/cjsonformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ bool CjsonFormat::deserialize(std::istream& file, Molecule& molecule,
}
}

if (jsonRoot.contains("unitCell")) {
if (jsonRoot.contains("unitCell") || jsonRoot.contains("unit cell")) {
json unitCell = jsonRoot["unitCell"];
if (!unitCell.is_object())
unitCell = jsonRoot["unit cell"];
Expand Down Expand Up @@ -381,7 +381,8 @@ bool CjsonFormat::deserialize(std::istream& file, Molecule& molecule,
}
}

if (atoms["coords"].contains("3dFractional")) {
if (atoms["coords"].contains("3dFractional") ||
atoms["coords"].contains("3d fractional")) {
json fractional = atoms["coords"]["3dFractional"];
if (!fractional.is_array())
fractional = atoms["coords"]["3d fractional"];
Expand Down

0 comments on commit 079510f

Please sign in to comment.