General Information for CLI
Categories:
PM has a command line interface (CLI), named pm, to access the various capabilities PM,
generated using PM’s DataSchemer package.
For the most part, a given CLI option is associated with a class within PM.
As outlined below,
basic documentation about all commands can be obtained at the command line,
and therefore this website only provides individualized attention to
selected CLI options which are nontrivial.
The CLI is called pm, and should be followed by a command tag,
such as pm lattice, pm crystal, etc. All CLI commands can be seen
by using pm -h or via
tab completion
$ pm <TAB><TAB>
abinitio-output displaced-crystal lattice-ftg
cluster disp-qrep orbit-qrep
convert-id-main-to-dev file-hive phonons-via-irr-derivatives
crystal get-variable-doc point-group-viewer
crystal-format irr-rep-product prototype-xtal
crystal-ftg irr-rep-symmetric-product star-rep
crystal-variables kpoints-fsg tensor-irr-rep
crystal-viewer lattice
The options for a given CLI command can be seen using pm command -h.
Assuming that the python module
argcomplete has been installed and set up, all CLI options can also be seen
by typing the command name followed by - and pressing tab twice.
$ pm crystal -<TAB><TAB>
--basis-atoms --input-files --shift-atom
--convert-to-supercell --lattice-vectors --shift-into-cell
--degub --permute-atoms --shift-origin
-h --precision --strict-input
--help --print-attribute --use-cartesian-coordinates
-i --rotate-lattice-vectors
For options that have restricted inputs, tab completion will show valid choices:
$ pm crystal --print-attribute<TAB><TAB>
atom_names lattice_vectors_length reciprocal_vectors_angle
atoms_cartesian mass_vector reciprocal_vectors_length
atoms_species_map natoms reciprocal_volume
basis_atoms nspecies space_dim
center positions species
lattice_dimension positions_cartesian species_names
lattice_vectors precision species_to_elements
lattice_vectors_angle reciprocal_vectors volume
Executing -h will print out the command information
$ pm crystal -h
usage: pm crystal [-h] --basis-atoms ATOMS --lattice-vectors VEC [--shift-into-cell]
[--convert-to-supercell S] [--use-cartesian-coordinates] [--permute-atoms X]
[--shift-origin X] [--rotate-lattice-vectors O] [--shift-atom AMP]
[--precision N] [--degub] [--input-files FILE [FILE ...]] [--strict-input]
[--print-attribute ATTR [ATTR ...]]
Exposes the Crystal class, allowing the basic properties of a crystal to be constructed.
options:
-h, --help show this help message and exit
--basis-atoms ATOMS (required) Basis atoms of the crystal structure.
--lattice-vectors VEC
(required) Lattice vectors in three dimensions, stored in a
matrix \(\hat a\).
--shift-into-cell Shift atoms such that they are within the conventional unit cell.
Entering the command without any options will print out the missing required arguments:
$ pm crystal
User Error: Must provide values for:
basis_atoms, lattice_vectors
Input tags can be provided on the command line, or they can be specified in yaml format
from standard input
or a file via the --input-file or -i tag.
Standard input is specified as - and an input file is given by name, such
as
$ pm crystal -i -
$ pm crystal -i input.yaml
Multiple input files can be specified, and can be mixed with standard input.
$ pm crystal -i input1.yaml input2.yaml
$ pm crystal -i - input1.yaml input2.yaml
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.