Skip to content

Commit

Permalink
[WIP] Documentation update (#850)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
AntObi and utf committed Jul 18, 2024
1 parent 7b719e5 commit a9e5ede
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 7 additions & 6 deletions src/atomate2/cp2k/schemas/calc_types/_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("+", "_")
Expand All @@ -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},
)

Expand All @@ -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)
Expand All @@ -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
"""
Expand Down

0 comments on commit a9e5ede

Please sign in to comment.