config module

configuration for faps

Provides the Options class that will transparently handle the different option sources through the .get() method. Pulls in defaults, site and job options plus command line customisation. Instantiating Options will set up the logging for the particular job.

class config.Options(job_name=None)[source]

Bases: object

Transparent options handling.

A single unified way of dealing with input files and command line options delivering sensible defaults for unspecified values. Access options with the .get() method, or the method that specifies the expected type. It is recommended to replace with a new instance each time the script is run, otherwise commandline options or changed input files will not be picked up.

commandline()[source]

Specified options, highest priority.

get(item)[source]

Map values from different sources based on priorities.

getbool(item)[source]

Parse option and if the value of item is not already a bool return True for “1”, “yes”, “true” and “on” and False for “0”, “no”, “false” and “off”. Case-insensitive.

getfloat(item)[source]

Return item’s value as a float.

getint(item)[source]

Return item’s value as an integer.

gettuple(item, dtype=None)[source]

Return item’s value interpreted as a tuple of ‘dtype’ [strings].

load_defaults()[source]

Load program defaults.

load_job_defaults()[source]

Find where the job is running and load defaults

load_job_type(job_type)[source]

Find where the job is running and load defaults

load_site_defaults()[source]

Find where the script is and load defaults