Skip to content

Commit 2442230

Browse files
committed
Add docs for the CLI
* utils.get_names is replaed with utils.load_json
1 parent 6415ff5 commit 2442230

File tree

13 files changed

+86
-50
lines changed

13 files changed

+86
-50
lines changed

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ sphinxcontrib-qthelp
1919
sphinxcontrib-serializinghtml
2020
sphinxemoji
2121
sphinx-issues
22+
sphinxcontrib-programoutput

docs/source/changes.rst

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
|:pushpin:| Changes
2-
===================
1+
|:pushpin:| Changelog
2+
=====================
3+
4+
Version 0.1.2
5+
-------------
6+
7+
.. versionadded:: 0.1.2
8+
9+
* :func:`moxel.utils.load_json`
10+
* Documentation for the :ref:`cli`.
11+
12+
.. versionremoved:: 0.1.2
13+
14+
* :func:`moxel.utils.get_names`
315

416
Version 0.1.1
517
-------------
@@ -21,13 +33,14 @@ Version 0.1.0
2133
* The usage of the CLI is now ``moxel <command>`` instead of ``python -m
2234
moxel``.
2335

24-
.. versionremoved:: 0.1.0
25-
26-
* Easy imports, such as ``from moxel import Grid``.
27-
* :func:`moxel.utils.batch_clean_and_merge`
28-
2936
.. versionadded:: 0.1.0
3037

3138
* :func:`moxel.utils.batch_clean`
3239
* :func:`moxel.visualize.plot_voxels_pv` for faster visualization.
3340
* Optional parameter ``n_jobs`` for specifying number of cores.
41+
42+
.. versionremoved:: 0.1.0
43+
44+
* Easy imports, such as ``from moxel import Grid``.
45+
* :func:`moxel.utils.batch_clean_and_merge`
46+

docs/source/cli.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55

66
There are two available commands: ``[create, clean]``
77

8-
.. code-block:: console
8+
``moxel``
9+
---------
10+
.. program-output:: moxel --help
911

10-
$ moxel <command> --help
12+
``moxel create``
13+
----------------
14+
15+
.. program-output:: moxel create --help
16+
17+
``moxel clean``
18+
---------------
19+
20+
.. program-output:: moxel clean --help

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
'sphinxarg.ext',
2929
'sphinx_code_tabs',
3030
'sphinx_issues',
31+
'sphinxcontrib.programoutput',
3132
]
3233

3334
templates_path = ['_templates']

docs/source/moxel.rst

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,14 @@
33
|:books:| API Documentation
44
---------------------------
55

6-
moxel package
7-
=============
8-
96
.. automodule:: moxel
107
:members:
118
:undoc-members:
129
:show-inheritance:
1310

14-
Submodules
15-
==========
16-
17-
moxel.utils
18-
===========
19-
20-
.. automodule:: moxel.utils
21-
:members:
22-
:undoc-members:
23-
:show-inheritance:
24-
25-
moxel.visualize
26-
===============
11+
.. toctree::
12+
:maxdepth: 2
13+
:caption: Submodules:
2714

28-
.. automodule:: moxel.visualize
29-
:members:
30-
:undoc-members:
31-
:show-inheritance:
15+
utils
16+
visualize

docs/source/utils.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
moxel.utils
2+
===========
3+
4+
.. automodule:: moxel.utils
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/visualize.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
moxel.visualize
2+
===============
3+
4+
.. automodule:: moxel.visualize
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
[project.urls]
4040
Homepage = "https://github.com/adosar/moxel"
4141
Documentation = "https://moxel.readthedocs.io"
42-
Changelog = "https://moxel.readthedocs.io/en/stable/changes.html"
42+
Changelog = "https://moxel.readthedocs.io/en/stable/changelog.html"
4343

4444
[project.scripts]
45-
moxel = "moxel.cli:moxel_fire"
45+
moxel = "moxel._cli:moxel_fire"

src/moxel/cli.py renamed to src/moxel/_cli.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,19 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
r"""
18+
This module provides helper functions for the CLI.
19+
"""
20+
1721
import fire
1822
from . utils import voxels_from_dir, batch_clean
1923

2024

2125
def moxel_fire():
22-
fire.Fire({
23-
'clean': batch_clean,
24-
'create': voxels_from_dir,
25-
})
26+
r"""
27+
Run the CLI.
28+
"""
29+
fire.Fire({
30+
'clean': batch_clean,
31+
'create': voxels_from_dir,
32+
})

src/moxel/_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
r"""
18+
This module provides the Lennard-Jones parameters from UFF.
19+
"""
20+
1721
lj_params = {
1822
"H": [
1923
22.11417,

0 commit comments

Comments
 (0)