Task#

class Task[source]#

Bases: Config

Runs the YARARA pipeline

Attributes

Note: attributes inherited from parent classes are not shown here, if any

description_

Text to display before the argument help

env_prefix_

Prefix for automatically derived environment variable names

ini_relaxed_sections_

Names of sections to parse in configuration files, with unknown keys ignored

ini_strict_sections_

Names of additional sections to parse in configuration files, unknown keys error

prog

prog_

Program name

stage_start

Stage at which to start the processing

stage_break

Stage before which to stop the processing

reference

reference

close_figure

Whether to close plots

data_folder

Path to the data to process

simbad_folder

Path to the SIMBAD database folder

mask_ccf_folder

Path to the mask_ccf folder

material_folder

Path to the material folder

Methods

from_command_line_

Parses multiple information sources into a configuration and display help on error

get_argument_parser_

Returns an argparse.ArgumentParser for documentation purposes

ini_sections_

Returns a sequence of INI file sections to parse

parse_command_line_

Parses multiple information sources, returns a configuration, a command or an error

parse_ini_contents_

Parses the contents of an INI file into a configuration

parse_ini_file_

Parses an INI file into a configuration

processor_

Returns a processor for this configuration

validate_data_folder

rtype:

Optional[Err]

validators_

Returns all validators present in the given subclass of this class

version_

Returns the version number of this script

List of members of Task

prog = 'run_yarara'#
stage_start: int[int]#

Stage at which to start the processing

stage_break: int[int]#

Stage before which to stop the processing

reference: Optional[str][Optional[str]]#

reference

Type:

TODO

close_figure: bool[bool]#

Whether to close plots

data_folder: Path[Path]#

Path to the data to process

The path must have the format “STARNAME/data/s1d/INSTRUMENT/” It must also contain a WORKSPACE/ subfolder.

simbad_folder: Path[Path]#

Path to the SIMBAD database folder

mask_ccf_folder: Path[Path]#

Path to the mask_ccf folder

material_folder: Path[Path]#

Path to the material folder

validate_data_folder()[source]#
Return type:

Optional[Err]

__init__(stage_start, stage_break, reference, close_figure, data_folder, simbad_folder, mask_ccf_folder, material_folder)#
description_: ClassVar[Optional[str]] = None#

Text to display before the argument help

If not present, taken from the Config subclass docstring.

env_prefix_: ClassVar[str] = ''#

Prefix for automatically derived environment variable names

classmethod from_command_line_(cwd=None, args=None, env=None)#

Parses multiple information sources into a configuration and display help on error

Default values are taken from the current working directory, the script command line arguments, and the current environment variables.

Parameters:
Return type:

TypeVar(_Config, bound= Config)

Returns:

A parsed configuration

classmethod get_argument_parser_()#

Returns an argparse.ArgumentParser for documentation purposes

This may be removed or deprecated in later versions of configpile, if we write our own help/usage display function, and propose a Sphinx extension.

Return type:

ArgumentParser

ini_relaxed_sections_: ClassVar[Sequence[str]] = ['Common', 'COMMON', 'common']#

Names of sections to parse in configuration files, with unknown keys ignored

classmethod ini_sections_()#

Returns a sequence of INI file sections to parse

By default, this parses first the relaxed sections and then the strict ones.

First, try to replace the contents of ini_relaxed_sections_ and ini_strict_sections_. Otherwise, override this method.

Return type:

Sequence[IniSection]

ini_strict_sections_: ClassVar[Sequence[str]] = []#

Names of additional sections to parse in configuration files, unknown keys error

classmethod parse_command_line_(cwd=None, args=None, env=None)#

Parses multiple information sources, returns a configuration, a command or an error

Default values are taken from the current working directory, the script command line arguments, and the current environment variables.

Parameters:
Return type:

Union[TypeVar(_Config, bound= Config), SpecialAction, Err]

Returns:

A parsed configuration or an error

classmethod parse_ini_contents_(ini_contents)#

Parses the contents of an INI file into a configuration

This method skips the processing of environment variables and command-line parameters.

Parameters:

ini_contents (str) – Multiline string describing the configuration contents

Return type:

Union[TypeVar(_Config, bound= Config), Err]

Returns:

A parsed configuration or an error

classmethod parse_ini_file_(ini_file_path)#

Parses an INI file into a configuration

This method skips the processing of environment variables and command-line parameters.

Parameters:

ini_file_path (Path) – Path to an INI file

Return type:

Union[TypeVar(_Config, bound= Config), Err]

Returns:

A parsed configuration or an error

classmethod processor_()#

Returns a processor for this configuration

Return type:

Processor[TypeVar(_Config, bound= Config)]

prog_: ClassVar[Optional[str]] = None#

Program name

classmethod validators_()#

Returns all validators present in the given subclass of this class

Validators are methods that take no arguments (except self) and return an optional error. Their name starts with validate_.

Return type:

Sequence[Callable[[TypeVar(_Config, bound= Config)], Optional[Err]]]

Returns:

A sequence of all validators

classmethod version_()#

Returns the version number of this script

Designed to be overridden by a subclass

Return type:

Optional[str]

Returns:

Version number as a string