Skip to content

Commit 142db2d

Browse files
committed
updates to docs for core
1 parent 9d1d369 commit 142db2d

File tree

1 file changed

+86
-5
lines changed

1 file changed

+86
-5
lines changed

docs/for_core/cli.rst

Lines changed: 86 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ to develop plugins for the CLI, see its documentation. The CLI subcommands
2828
are defined through a plugin system, which makes it very easy for developers
2929
to create new subcommands.
3030

31-
* CLI documentation:
32-
* CLI code repository:
31+
* CLI documentation: https://openpathsampling-cli.readthedocs.io/
32+
* CLI code repository: https://github.com/openpathsampling/openpathsampling-cli/
3333

3434
Workflow with the CLI
3535
---------------------
@@ -41,6 +41,76 @@ files.
4141

4242
To use it, you'll want to first set up
4343

44+
45+
Finding your way around the CLI
46+
-------------------------------
47+
48+
Like many command line tools, the OPS CLI has the options ``-h`` or
49+
``--help`` to get help. If you run ``openpathsampling --help`` you should
50+
see something like this::
51+
52+
Usage: openpathsampling [OPTIONS] COMMAND [ARGS]...
53+
54+
OpenPathSampling is a Python library for path sampling simulations. This
55+
command line tool facilitates common tasks when working with
56+
OpenPathSampling. To use it, use one of the subcommands below. For
57+
example, you can get more information about the pathsampling tool with:
58+
59+
openpathsampling pathsampling --help
60+
61+
Options:
62+
--log PATH logging configuration file
63+
-h, --help Show this message and exit.
64+
65+
Simulation Commands:
66+
visit-all Run MD to generate initial trajectories
67+
equilibrate Run equilibration for path sampling
68+
pathsampling Run any path sampling simulation, including TIS variants
69+
70+
Miscellaneous Commands:
71+
contents list named objects from an OPS .nc file
72+
append add objects from INPUT_FILE to another file
73+
74+
The ``--log`` option takes a logging configuration file (e.g., `logging.conf
75+
<>`_, and sets that logging behavior. If you use it, it must come before the
76+
subcommand name.
77+
78+
You can find out more about each subcommand by putting ``--help`` *after*
79+
the subcommand name, e.g., ``openpathsampling pathsampling --help``, which
80+
returns::
81+
82+
Usage: openpathsampling pathsampling [OPTIONS] INPUT_FILE
83+
84+
General path sampling, using setup in INPUT_FILE
85+
86+
Options:
87+
-o, --output-file PATH output ncfile [required]
88+
-m, --scheme TEXT identifier for the move scheme
89+
-t, --init-conds TEXT identifier for initial conditions (sample set or
90+
trajectory)
91+
-n, --nsteps INTEGER number of Monte Carlo trials to run
92+
-h, --help Show this message and exit.
93+
94+
Here you see the list of the options for the running a path sampling
95+
simulation. In general, path sampling requires an output
96+
file, a move scheme and initial conditions from some input file, and the
97+
number of steps to run. Note that only the output file is technically
98+
required: the CLI will default to running 0 steps (essentially, testing the
99+
validity of your setup), and it can try to guess the move scheme and initial
100+
conditions. In general, the way it guesses follows the following path:
101+
102+
1. If there is only one object of the suitable type in the INPUT_FILE, use
103+
that.
104+
2. If there are multiple objects of the correct type, but only one has a
105+
name, use the named object.
106+
3. In special cases it looks for specific names, such as
107+
``initial_conditions``, and will use those.
108+
109+
Full details on how various CLI parameters search the storage can be seen in
110+
the `Parameter Interpretation
111+
<https://openpathsampling-cli.readthedocs.io/en/latest/interpretation.html>`_
112+
section of the CLI docs.
113+
44114
Simulation Commands
45115
-------------------
46116

@@ -68,9 +138,6 @@ Here are some of the simulation commands implemented in the OPS CLI:
68138
have been visited (works for MSTIS or any 2-state system); must provide
69139
states, engine, and initial snapshot on command line
70140

71-
.. TODO figure showing how these all work -- what is needed for each, what
72-
is implicit
73-
74141
Miscellaneous Commands
75142
----------------------
76143

@@ -89,3 +156,17 @@ the CLI:
89156
* ``append`` : add an object from once OPS storage into another one; this is
90157
useful for getting everything into a single file before running a
91158
simulation
159+
160+
Customizing the CLI
161+
-------------------
162+
163+
The OPS CLI uses a flexible plugin system to enable users to easily add
164+
custom functionality. This way, you can create and distribute custom
165+
plugins, giving more functionality to other users who would benefit from it,
166+
without adding everything to the core package and thus overwhelming new
167+
users.
168+
169+
Installing a plugin is easy: just create the directory
170+
``$HOME/.openpathsampling/cli-plugins/``, and copy the plugin Python script
171+
into there. For details on how to write a CLI plugin, see the `CLI
172+
development docs <https://openpathsampling-cli.readthedocs.io/>`_.

0 commit comments

Comments
 (0)