MCPcopy Create free account
hub / github.com/SZAILAB/MaterialDFT-Demo / require_dict

Function require_dict

cpp_core/src/module_case_input.cpp:16–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace materialdft {
15
16py::dict require_dict(const py::dict& parent, const char* key, const std::string& where) {
17 if (!parent.contains(key)) {
18 throw std::invalid_argument(where + "." + key + " is required");
19 }
20 if (!py::isinstance<py::dict>(parent[key])) {
21 throw std::invalid_argument(where + "." + key + " must be an object");
22 }
23 return py::cast<py::dict>(parent[key]);
24}
25
26py::list require_list(const py::dict& parent, const char* key, const std::string& where) {
27 if (!parent.contains(key)) {

Callers 3

parse_supported_kpointsFunction · 0.85
execute_relax_caseFunction · 0.85
execute_caseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected