Skip to content

Commit 194f664

Browse files
authored
docs: use dargs directive (#196)
* docs: use dargs directive * bump dargs version
1 parent 5adeeba commit 194f664

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

doc/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# ones.
3232
extensions = [
3333
'deepmodeling_sphinx',
34+
'dargs.sphinx',
3435
'myst_parser',
3536
"sphinx_rtd_theme",
3637
'sphinx.ext.viewcode',
@@ -72,12 +73,9 @@ def run_apidoc(_):
7273
module = os.path.join(cur_dir, "..", "dpdispatcher")
7374
main(['-M', '--tocfile', 'api', '-H', 'DPDispatcher API', '-o', os.path.join(cur_dir, "api"), module, '--force'])
7475

75-
def generate_train_input(app):
76-
subprocess.check_output((sys.executable, os.path.join("..", "scripts", "script_gen_dargs_docs.py")), universal_newlines=True)
7776

7877
def setup(app):
7978
app.connect('builder-inited', run_apidoc)
80-
app.connect('builder-inited', generate_train_input)
8179

8280

8381
intersphinx_mapping = {

doc/examples/shell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Running multiple MD tasks on a GPU workstation
1+
# Running multiple MD tasks on a GPU workstation
22

33
In this example, we are going to show how to run multiple MD tasks on a GPU workstation. This workstation does not install any job scheduling packages installed, so we will use `Shell` as `batch_type`.
44

doc/machine.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ Machine parameters
33
.. note::
44
One can load, modify, and export the input file by using our effective web-based tool `DP-GUI <https://deepmodeling.com/dpgui/input/dpdispatcher-machine>`_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
55

6-
.. include:: machine-auto.rst
6+
.. dargs::
7+
:module: dpdispatcher.arginfo
8+
:func: machine_dargs

doc/resources.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ Resources parameters
33
.. note::
44
One can load, modify, and export the input file by using our effective web-based tool `DP-GUI <https://deepmodeling.com/dpgui/input/dpdispatcher-resources>`_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file for.
55

6-
.. include:: resources-auto.rst
6+
.. dargs::
7+
:module: dpdispatcher.arginfo
8+
:func: resources_dargs

doc/task.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ Task parameters
33
.. note::
44
One can load, modify, and export the input file by using our effective web-based tool `DP-GUI <https://deepmodeling.com/dpgui/input/dpdispatcher-task>`_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.
55

6-
.. include:: task-auto.rst
6+
.. dargs::
7+
:module: dpdispatcher.arginfo
8+
:func: task_dargs

dpdispatcher/arginfo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from dpdispatcher.submission import Resources, Task
2+
from dpdispatcher.machine import Machine
3+
4+
resources_dargs = Resources.arginfo
5+
machine_dargs = Machine.arginfo
6+
task_dargs = Task.arginfo

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
keywords='deep potential generator active learning deepmd-kit',
4141
install_requires=install_requires,
4242
extras_require={
43-
'docs': ['sphinx', 'myst-parser', 'sphinx_rtd_theme>=1.0.0rc1', 'numpydoc', 'deepmodeling_sphinx'],
43+
'docs': ['sphinx', 'myst-parser', 'sphinx_rtd_theme>=1.0.0rc1', 'numpydoc', 'deepmodeling_sphinx', 'dargs>=0.3.1'],
4444
"cloudserver": ["oss2", "tqdm"],
4545
":python_version<'3.7'": ["typing_extensions"],
4646
},

0 commit comments

Comments
 (0)