|
| 1 | +.. _cli: |
| 2 | + |
| 3 | +Command Line Interface |
| 4 | +====================== |
| 5 | + |
| 6 | +A separate command line tool for OpenPathSamplng can be installed. It is |
| 7 | +available via either ``conda`` (channel ``conda-forge``) or ``pip``, with |
| 8 | +the package name ``openpathsampling-cli``. |
| 9 | + |
| 10 | +Once you install this, you'll have access to the command |
| 11 | +``openpathsampling`` in your shell (although we recommend aliasing that to |
| 12 | +either ``paths`` or ``ops`` -- save yourself some typing!) |
| 13 | + |
| 14 | +This command is a gateway to many subcommands, just like ``conda`` and |
| 15 | +``pip`` (which have subcommands such as ``install``) or ``git`` (which has |
| 16 | +subcommands such as ``clone`` or ``commit``). You can get a full listing all |
| 17 | +the subcommands with ``openpathsampling --help``. For more information on |
| 18 | +any given subcommand, use ``openpathsampling SUBCOMMAND --help``, replacing |
| 19 | +``SUBCOMMAND`` with the subcommand you're interested in. |
| 20 | + |
| 21 | +Here, we will provide a description of a few of the subcommands that the CLI |
| 22 | +tool provides. This documentation may not be fully up-to-date with the more |
| 23 | +recent releases of the CLI, so use the CLI help tools to get a fuller |
| 24 | +understanding of what is included. |
| 25 | + |
| 26 | +For more details on how the CLI interprets its arguments, and to learn how |
| 27 | +to develop plugins for the CLI, see its documentation. The CLI subcommands |
| 28 | +are defined through a plugin system, which makes it very easy for developers |
| 29 | +to create new subcommands. |
| 30 | + |
| 31 | +* CLI documentation: |
| 32 | +* CLI code repository: |
| 33 | + |
| 34 | +Workflow with the CLI |
| 35 | +--------------------- |
| 36 | + |
| 37 | +As always, the process of running a simulation is (1) set up the simulation; |
| 38 | +(2) run the simulation; (3) analyze the simulation. The CLI is mainly |
| 39 | +focused on step 2, although it also has tools that generally help with OPS |
| 40 | +files. |
| 41 | + |
| 42 | +To use it, you'll want to first set up |
| 43 | + |
| 44 | +Simulation Commands |
| 45 | +------------------- |
| 46 | + |
| 47 | +One of the main concepts when working with the CLI is that you can create |
| 48 | +all the OPS simulation objects without running the simulation, save them in |
| 49 | +an OPS storage file, and then load them again to actually run your |
| 50 | +simulation. For simulation commands, the options all deal with loading |
| 51 | +simulation objects from storage. |
| 52 | + |
| 53 | +The simulation commands include ``equilibration``, ``pathsampling``, and |
| 54 | +``simulation``. These commands aren'y necessarily mutually exclusive: you |
| 55 | +can accomplish an equilibration phase with any of them. The ``simulation`` |
| 56 | +command is the most general; if you've any :class:`.PathSimulator` object, |
| 57 | +??? |
| 58 | + |
| 59 | +Here are some of the simulation commands implemented in the OPS CLI: |
| 60 | + |
| 61 | +* ``pathsampling``: run path sampling with a given move scheme (suitable for |
| 62 | + custom TPS schemes as well as TIS/RETIS); must provide move scheme, |
| 63 | + iniital conditions, and number of MC steps on command line |
| 64 | +* ``simulation``: run arbitrary OPS simulator (including committor and |
| 65 | + related); must provide a simulator object and number of steps on the |
| 66 | + command line |
| 67 | +* ``visit-all``: create initial trajectories by running MD until all states |
| 68 | + have been visited (works for MSTIS or any 2-state system); must provide |
| 69 | + states, engine, and initial snapshot on command line |
| 70 | + |
| 71 | +.. TODO figure showing how these all work -- what is needed for each, what |
| 72 | + is implicit |
| 73 | +
|
| 74 | +Miscellaneous Commands |
| 75 | +---------------------- |
| 76 | + |
| 77 | +Even for users who prefer to develop their OPS projects entirely in Python, |
| 78 | +foregoing the CLI tools to run simulations, some of the "miscellaneous" |
| 79 | +commands are likely to be quite useful. Here are some that are available in |
| 80 | +the CLI: |
| 81 | + |
| 82 | +* ``nclist``: list all the named objects in an OPS storage, organized by |
| 83 | + store (type); this is extremely useful to get the name of an object to use |
| 84 | + as command-line input to one of the simulation scripts |
| 85 | +* ``strip-snapshots``: create a copy of the input storage file with the |
| 86 | + details (coordinates/velocities) of all snapshots removed; this allows you |
| 87 | + to make a much smaller copy (with results of CVs) to copy back to a local |
| 88 | + computer for analysis |
0 commit comments