diff --git a/util/dependencies.cmake b/util/dependencies.cmake index 5b4c2590..c91a7eb4 100644 --- a/util/dependencies.cmake +++ b/util/dependencies.cmake @@ -31,9 +31,9 @@ FetchContent_Declare( FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt - GIT_TAG 10.0.0 + GIT_TAG 10.1.1 GIT_SHALLOW TRUE - FIND_PACKAGE_ARGS 10.0.0 + FIND_PACKAGE_ARGS 10.1.1 ) # library: pybind11 diff --git a/vipster/plugins/json.cpp b/vipster/plugins/json.cpp index 23fed422..104099ab 100644 --- a/vipster/plugins/json.cpp +++ b/vipster/plugins/json.cpp @@ -68,7 +68,7 @@ void parseStep(const json &j, Molecule &m) } auto coord = at.find("coord"); if(coord == at.end() || !coord->is_array() || !(coord->size() == 3)){ - throw IOError(fmt::format("JSON-Parser: Invalid atom (missing or invalid \"coord\"): {}", at)); + throw IOError(fmt::format("JSON-Parser: Invalid atom (missing or invalid \"coord\"): {}", at.dump())); } s.newAtom(name->get(), {(*coord)[0].get(), (*coord)[1].get(), (*coord)[2].get()}); } @@ -78,13 +78,13 @@ void parseStep(const json &j, Molecule &m) // check if atoms are valid auto at_pos = bond.find("atoms"); if(at_pos == bond.end()){ - throw IOError(fmt::format("JSON-Parser: Missing atom ids in bond {}", bond)); + throw IOError(fmt::format("JSON-Parser: Missing atom ids in bond {}", bond.dump())); } const auto &atoms = at_pos.value(); if(!(atoms.is_array() && (atoms.size() == 2) && atoms[0].is_number_unsigned() && atoms[1].is_number_unsigned() && (atoms[0].get() < s.getNat()) && (atoms[1].get() < s.getNat()))){ - throw IOError(fmt::format("JSON-Parser: Invalid atom ids in bond {}", bond)); + throw IOError(fmt::format("JSON-Parser: Invalid atom ids in bond {}", bond.dump())); } // parse optional pbc information DiffVec diff{}; @@ -93,7 +93,7 @@ void parseStep(const json &j, Molecule &m) const auto &pbc = pbc_pos.value(); if(!(pbc.is_array() && pbc.size() == 3 && pbc[0].is_number() && pbc[1].is_number() && pbc[2].is_number())){ - throw IOError(fmt::format("JSON-Parser: Invalid periodic bond {}", bond)); + throw IOError(fmt::format("JSON-Parser: Invalid periodic bond {}", bond.dump())); } diff = {pbc[0].get(), pbc[1].get(), pbc[2].get()}; } @@ -133,7 +133,7 @@ IOTuple JSONParser(const std::string& name, std::istream &file) parseStep(j, m); } }else{ - throw IOError(fmt::format("JSON-Parser: invalid molecule data {}", mol.value())); + throw IOError(fmt::format("JSON-Parser: invalid molecule data {}", mol->dump())); } }catch(nlohmann::detail::exception& e){ throw IOError(e.what());