-
Notifications
You must be signed in to change notification settings - Fork 612
Expand file tree
/
Copy pathdoc.py
More file actions
29 lines (24 loc) · 786 Bytes
/
doc.py
File metadata and controls
29 lines (24 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Module that prints train input arguments docstrings."""
from typing import (
Any,
)
from deepmd.utils.argcheck import (
gen_doc,
gen_json,
gen_json_schema,
)
__all__ = ["doc_train_input"]
def doc_train_input(
*, out_type: str = "rst", multi_task: bool = False, **kwargs: Any
) -> None:
"""Print out trining input arguments to console."""
if out_type == "rst":
doc_str = gen_doc(make_anchor=True, multi_task=multi_task)
elif out_type == "json":
doc_str = gen_json(multi_task=multi_task)
elif out_type == "json_schema":
doc_str = gen_json_schema(multi_task=multi_task)
else:
raise RuntimeError(f"Unsupported out type {out_type}")
print(doc_str) # noqa: T201