defaults

The defaults util allows the display and modification of the user defaults. These defaults values control some basic behaviors of the different utils, such as the number of decimals shown for energies or the preferred suffixes used by the user ( for example .com vs .gjf vs .in or .out vs .log). There are two main subactions:

show

usage: pyssianutils defaults show [-h] [--section SECTION] [--all] [--path]
                                  [parameter]

Positional Arguments

parameter

name of the parameter whose value should be displayed. 'all' will show all parameters.

Named Arguments

--section

Allows to filter the parameters for a single section. If no section, no parameter and no other flag is requested a list of the sections available will be displayed.

--all

show all parameters

Default: False

--path

shows the path to the 'defaults.ini' file

Default: False

Examples

If the user prefers to change the defaults using a text editor, to know the location of the defaults file:

$ pyssianutils defaults show --path

Other examples of the usage of the "defaults show" command include:

Display all sections

$ pyssianutils defaults show
[common]
[submit]
...
[submit.slurm]

Display the values of all parameters in a specific section

$ pyssianutils defaults show --section common
in_suffix = .com
out_suffix = .log
default_marker = new
gaussian_in_suffixes = (.com,.gjf,.in)
gaussian_out_suffixes = (.com,.gjf,.in)

Display the value of a specific parameter

$ pyssianutils defaults show in_suffix --section common
in_suffix = .com

Display the value of all parameters with a specific name

$ pyssianutils defaults show color --all
[plot.optview.gridA]
    color = k
[plot.optview.gridB]
    color = k
[plot.property]
    color = k

set

usage: pyssianutils defaults set [-h] [--section SECTION] [--all]
                                 parameter value

Positional Arguments

parameter

name of the parameter whose value should set

value

value to set in the parameter

Named Arguments

--section

Section of the parameter. If none provided it will attempt to guess it. From guessing it if there is only one parameter with the provided name it will set the new value. Otherwise it will refuse and will show the sections containing that parameter name

--all

If enabled it forces the update on all parameters with the same name

Default: False

Examples

Change the value of all parameters with a specific name

$ pyssianutils defaults set color "#501616ff" --all
    setting [plot.optview.gridA][color] = #501616ff
    setting [plot.optview.gridB][color] = #501616ff
    setting [plot.property][color] = #501616ff
storing new defaults

Change the value of a specific parameter

$ pyssianutils defaults set color "k" --section plot.property
    setting [plot.property][color] = k
storing new defaults

Or if its name is unique:

$ pyssianutils defaults set in_suffix ".gjf"
    setting [common][in_suffix] = .gjf
storing new defaults

reset

usage: pyssianutils defaults reset [-h] [--section SECTION] [--all]
                                   [parameter]

Positional Arguments

parameter

name of the parameter whose value should reset. If none is provided it will reset all user defaults

Named Arguments

--section

Section of the parameter. If none provided it will attempt to guess it. From guessing it if there is only one parameter with the provided name it will set the new value. Otherwise it will refuse and will show the sections containing that parameter name

--all

If enabled it forces the update on all parameters with the same name

Default: False

Examples

Change the value of all parameters with a specific name

$ pyssianutils defaults reset color --all
    resetting [plot.optview.gridA][color] = k
    resetting [plot.optview.gridB][color] = k
    resetting [plot.property][color] = k
storing new defaults

Change the value of a specific parameter

$ pyssianutils defaults reset color --section plot.property
    resetting [plot.property][color] = k
storing new defaults

Or if its name is unique:

$ pyssianutils defaults reset in_suffix
    setting [common][in_suffix] = .com
storing new defaults