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

Method _invoke_cpp

src/materialdft/backends/cpp_core.py:493–503  ·  view source on GitHub ↗
(self, module: Any, request: dict[str, Any])

Source from the content-addressed store, hash-verified

491 return out
492
493 def _invoke_cpp(self, module: Any, request: dict[str, Any]) -> dict[str, Any]:
494 try:
495 payload = module.execute_case(request)
496 except Exception as exc:
497 raise BackendExecutionError(f"cpp_core execution failed: {exc}", "RUNTIME_ERROR", "SCF") from exc
498 if not isinstance(payload, dict):
499 raise BackendExecutionError("cpp_core returned invalid payload type", "RUNTIME_ERROR", "POSTPROCESS")
500 output = payload.get("output")
501 if not isinstance(output, dict):
502 raise BackendExecutionError("cpp_core payload missing output object", "RUNTIME_ERROR", "POSTPROCESS")
503 return payload
504
505 def _normalize_diagnostics(self, mode: str, output: dict[str, Any], diagnostics: dict[str, Any]) -> dict[str, Any]:
506 out = dict(diagnostics)

Calls 2

execute_caseMethod · 0.80