config Class

class plask.config

Global PLaSK configuration.

This class has only one instance and it contains global configuration options. The attributes of this class are config parameters that can be set using the config object.

Example

>>> config.axes = 'xy'
>>> config.log.level = 'debug'
>>> print config
axes:        zxy
log.colors:  ansi
log.level:   DEBUG
log.output:  stdout

Attributes

axes String representing axis names.
log Settings of the logging system.
nan_on_error Ignore error for array computations and return NAN.

Descriptions

Attribute Details

config.axes

String representing axis names.

The accepted values are listed below. Each row shows different aliases for the same axes:

xyz yz z_up
zxy xy y_up
prz rz rad
ltv   abs
long,tran,vert   absolute

The choice of the axes should depend on your structure. In Cartesian coordinates you probably prefer xyz or zxy. In cylindrical ones the most natural choice is prz. However, it is important to realize that any names can be chosen in any geometry and they are fully independent from it.

config.log

Settings of the logging system.

This setting has several subattributes listed below:

color

System used for coloring the log messages depending on their level. This parameter can have on of the following values:

ansi:Use ANSI codes for coloring. Works best in UNIX-like systems (Linux, OSX) or with GUI launchers.
windows:Use Windows API for coloring. Available only on Windows.
none:Do not perform coloring at all. Recommended when redirecting output to a file.

On its start PLaSK tries to automatically determine the best value for this option, so usually you will not need to change it.

level

Maximum logging level. It can be one of:

CRITICAL_ERROR:Critical errors that result in program interruption.
ERROR:Minor errors that do not break the whole program flow.
ERROR_DETAIL:Details of the errors with more information on them.
WARNING:Important warnings that you should investigate.
INFO:General information of the executed operations.
RESULT:Some intermediate computations results.
DATA:Some data used for tracking the computations.
DETAIL:Details of computations processes.
DEBUG:Additional information useful for debugging PLaSK.

Setting any of the above levels will instruct PLaSK to print only information of the specified level and above. It is recommended to always set the logging level at least to ‘WARNING’. This setting is ignored when the plask option -l is specified.

output
Stream to which the log messages are printed. Can be either stderr (which is the default) or stdout (turned on for interactive mode).
config.nan_on_error

Ignore error for array computations and return NAN.

If this parameter is True, some solver methods will not report computation errors if an array is passed as an argument. Instead, such methods will set the corresponding value in the result array to NAN.