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

Function _request

tests/test_cpp_core.py:112–153  ·  view source on GitHub ↗
(
    mode: str,
    *,
    xc: str = "NONE",
    scheme: str = "Gamma",
    grid: list[int] | None = None,
    shift: list[float] | None = None,
)

Source from the content-addressed store, hash-verified

110
111
112def _request(
113 mode: str,
114 *,
115 xc: str = "NONE",
116 scheme: str = "Gamma",
117 grid: list[int] | None = None,
118 shift: list[float] | None = None,
119) -> dict:
120 if grid is None:
121 grid = [1, 1, 1]
122 if shift is None:
123 shift = [0.0, 0.0, 0.0]
124 return {
125 "case_id": f"cpp_core_{mode}",
126 "mode": mode,
127 "input": {
128 "structure": {
129 "lattice": [[SC_A_ANG, 0.0, 0.0], [0.0, SC_A_ANG, 0.0], [0.0, 0.0, SC_A_ANG]],
130 "coordinate_mode": "Direct",
131 "atoms": [
132 {"element": "H", "position": [0.0, 0.0, 0.0]},
133 {"element": "H", "position": [0.5, 0.5, 0.5]},
134 ],
135 },
136 "settings": {
137 "xc": xc,
138 "encut_ev": 6.0 * 27.211386245988,
139 "kpoints": {"scheme": scheme, "grid": grid, "shift": shift},
140 "ediff": 1e-6,
141 "ismear": 0,
142 "nelm": 40,
143 "mix_beta": 0.4,
144 },
145 "files": {
146 "POSCAR": {"path": "input/POSCAR", "sha256": "0" * 64},
147 "INCAR": {"path": "input/INCAR", "sha256": "1" * 64},
148 "KPOINTS": {"path": "input/KPOINTS", "sha256": "2" * 64},
149 },
150 },
151 "resources": {},
152 "runtime_policy": {},
153 }
154
155def test_cpp_core_module_metadata_when_available() -> None:
156 if not materialdft_cpp_core.is_available():

Calls

no outgoing calls

Tested by

no test coverage detected