Skip to content

Commit

Permalink
generate run arg doc from scripts (#747)
Browse files Browse the repository at this point in the history
* generate run arg doc from scripts

This commit generates run argument documentations from scripts at runtime, so we can work on the script to improve the docs.

* remove `init_multi_systems`

see #730

* set repeat=True for model_devi_jobs

* switch to dargs directive

* switch for mdata

* add extension

* the current model_devi_args is indeed lammps arguments

* fix error

* fix error
  • Loading branch information
njzjz authored Jul 5, 2022
1 parent 48f2abe commit fd07f19
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 456 deletions.
4 changes: 0 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,5 @@ def run_apidoc(_):
main(['-M', '--tocfile', 'api', '-H', 'DP-GEN API', '-o', os.path.join(cur_dir, "api"), module, '--force'])


def generate_arginfo(app):
subprocess.check_output((sys.executable, "gen_arginfo.py"), universal_newlines=True)

def setup(app):
app.connect('builder-inited', run_apidoc)
app.connect('builder-inited', generate_arginfo)
5 changes: 0 additions & 5 deletions doc/gen_arginfo.py

This file was deleted.

6 changes: 3 additions & 3 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DPGEN's documentation

run/run-process.rst
run/param.rst
run-mdata.rst
run/mdata.rst

.. _init::

Expand Down Expand Up @@ -63,14 +63,14 @@ DPGEN's documentation
:caption: Tutorial
:glob:

toymodels/*
Tutorials <https://tutorials.deepmodeling.com/en/latest/Tutorials/DP-GEN/>


.. _Contribution:

.. toctree::
:maxdepth: 2
:caption: Contribution Guild
:caption: Contribution Guide

README.md
api/api
Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ sphinx_markdown_tables
sphinx-argparse
myst-parser
deepmodeling_sphinx
dargs>=0.3.1
.
4 changes: 3 additions & 1 deletion doc/run-mdata.rst → doc/run/mdata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ dpgen run machine parameters
.. note::
One can load, modify, and export the input file by using our effective web-based tool `DP-GUI <https://deepmodeling.com/dpgui/input/dpgen-machine>`_. All parameters below can be set in DP-GUI. By clicking "SAVE JSON", one can download the input file.

.. include:: run-mdata-auto.rst
.. dargs::
:module: dpgen.generator.arginfo
:func: run_mdata_arginfo
Loading

0 comments on commit fd07f19

Please sign in to comment.