From a9e5edecc267760c84562efe8101acc7390b61cc Mon Sep 17 00:00:00 2001 From: Anthony Onwuli <30937913+AntObi@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:53:38 +0100 Subject: [PATCH] [WIP] Documentation update (#850) * Add new subpackages to index.rst * Autoupdated Enums * Run pre-commit and fix enums * Add correct punctuation and line breaks to CP2K enum generate script --------- Co-authored-by: Alex Ganose --- docs/reference/index.rst | 6 ++++++ src/atomate2/cp2k/schemas/calc_types/_generate.py | 13 +++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 7b5b94c18d..2852812cda 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -12,9 +12,15 @@ This section gives an overview of the API for atomate2. :toctree: :nosignatures: + abinit + aims amset + cli common + cp2k + forcefields lobster + qchem settings utils vasp diff --git a/src/atomate2/cp2k/schemas/calc_types/_generate.py b/src/atomate2/cp2k/schemas/calc_types/_generate.py index 8881a144c3..a20ca90468 100644 --- a/src/atomate2/cp2k/schemas/calc_types/_generate.py +++ b/src/atomate2/cp2k/schemas/calc_types/_generate.py @@ -36,7 +36,7 @@ class {enum_name}(ValueEnum): run_type_enum = get_enum_source( "RunType", - "CP2K calculation run types", + "CP2K calculation run types.", { "_".join(rt.split()) .replace("+", "_") @@ -48,7 +48,7 @@ class {enum_name}(ValueEnum): ) task_type_enum = get_enum_source( "TaskType", - "CP2K calculation task types", + "CP2K calculation task types.", {"_".join(tt.split()): tt for tt in _TASK_TYPES}, ) @@ -62,7 +62,7 @@ def get_calc_type_key(rt: str) -> str: calc_type_enum = get_enum_source( "CalcType", - "CP2K calculation types", + "CP2K calculation types.", { f"{get_calc_type_key(rt)}_{'_'.join(tt.split())}": f"{rt} {tt}" for rt, tt in product(_RUN_TYPES, _TASK_TYPES) @@ -73,9 +73,10 @@ def get_calc_type_key(rt: str) -> str: with open(Path(__file__).parent / "enums.py", "w") as file: file.write( """\"\"\" -Autogenerated Enums for CP2K RunType, TaskType, and CalcType -Do not edit this by hand. Edit generate.py or run_types.yaml instead -\"\"\" +Autogenerated Enums for CP2K RunType, TaskType, and CalcType. + +Do not edit this by hand. Edit generate.py or run_types.yaml instead. +\"\"\"\n from emmet.core.utils import ValueEnum """