gwsumm.config package

Module contents

Thin wrapper around configparser

class gwsumm.config.GWSummConfigParser(*args, **kwargs)[source]

Bases: ConfigParser

OPTCRE = re.compile('(?P<option>[^=\\s][^=]*)\\s*(?P<vi>[=])\\s*(?P<value>.*)$')
finalize()[source]

Finalize this GWSummConfigParser by running all the loaders

This method is just a shortcut to run each of the following

load_plugins()

Load all plugin modules as defined in the [plugins] section

load_units()

Load all unit definitions as defined in the [units] section

load_channels()

Load all channel definitions as given in the selfuration

load_states([section])

Read and format a list of SummaryState definitions from the given :class:`~configparser.ConfigParser`

classmethod from_configparser(cp)[source]

Copy an existing :class:`~configparser.ConfigParser`.

get_css(section='html')[source]
get_javascript(section='html')[source]
interpolate_section_names(**kwargs)[source]

Interpolate a specific key in a section name using val

load_channels()[source]

Load all channel definitions as given in the selfuration

Channels are loaded from sections named [channels-…] or those sections whose name is a channel name in itself

load_plugins()[source]

Load all plugin modules as defined in the [plugins] section

load_rcParams(section='rcParams')[source]

Load custom matplotlib.rcParams for plots in this analysis

load_states(section='states')[source]

Read and format a list of SummaryState definitions from the given :class:`~configparser.ConfigParser`

load_units()[source]

Load all unit definitions as defined in the [units] section

nditems(section, **kwargs)[source]
ndoptions(section, **kwargs)[source]
optionxform

alias of str

read(filenames)[source]

Read and parse a filename or an iterable of filenames.

Files that cannot be opened are silently ignored; this is designed so that you can specify an iterable of potential configuration file locations (e.g. current directory, user’s home directory, systemwide directory), and all existing configuration files in the iterable will be read. A single filename may also be given.

Return list of successfully read files.

set_date_options(start, end, section='DEFAULT')[source]

Set datetime options in [DEFAULT] based on the given times

The following options are set

  • gps-start-time - the integer GPS start time of this job

  • gps-end-time - the integer GPS end time of this job

  • yyyy - the four-digit year of the start date

  • mm - the two-digit month of the start date

  • dd - the two-digit day-of-month of the start date

  • yyyymm - the six-digit year and month of the start date

  • yyyymmdd - the eight-digit year-month-day of the start date

  • duration - the duration of the job (seconds)

Additionally, if LAL is available, the following extra options are also set

  • leap-seconds - the number of leap seconds for the start date

  • gps-start-time-noleap - the leap-corrected integer GPS start time

  • gps-end-time-noleap - the leap-corrected integer GPS end time

set_ifo_options(ifo, observatory=None, section='DEFAULT')[source]

Set configurations options in [DEFAULT] based on the given ifo

The following options are set

  • IFO - the two-character interferometer prefix, e.g. L1

  • ifo - the two-character interferometer prefix in lower-case,

    e.g. l1

  • SITE - the single-character site ID, e.g. L

  • site - the single-character site ID,n lower-case e.g. l

Additionally, if observatory is given, or the ifo matches known observatories, the following option is set

  • observatory - the name of the observatory, e.g. LIGO Livingston