Base Task Manager

Base task manager class.

@author: Jesus Cid-Sueiro

class src.base_taskmanager.baseTaskManager(path2project, path2source=None, config_fname='parameters.yaml', metadata_fname='metadata.yaml', set_logs=True)

Bases: object

Base Task Manager class.

This class provides the basic functionality to create, load and setup an execution project from the main application

The behavior of this class might depend on the state of the project, which is stored in dictionary self.state, with the followin entries:

  • ‘isProject’ : If True, project created. Metadata variables loaded

  • ‘configReady’ : If True, config file succesfully loaded and processed

__init__(path2project, path2source=None, config_fname='parameters.yaml', metadata_fname='metadata.yaml', set_logs=True)

Sets the main attributes to manage tasks over a specific application project.

Parameters
  • path2project (str or pathlib.Path) – Path to the application project

  • path2source (str or pathlib.Path or None, optional (default=None)) – Paht to the folder containing the data sources for the application. If none, no source data is used.

  • config_fname (str, optional (default=’parameters.yaml’)) – Name of the configuration file

  • metadata_fname (str or None, optional (default=’metadata.yaml’)) – Name of the project metadata file.

  • set_logs (bool, optional (default=True)) – If True logger objects are created according to the parameters specified in the configuration file

__weakref__

list of weak references to the object (if defined)

create()

Creates an application project. To do so, it defines the main folder structure, and creates (or cleans) the project folder, specified in self.path2project

load()

Loads an existing project, by reading the metadata file in the project folder.

It can be used to modify file or folder names, or paths, by specifying the new names/paths in the f_struct dictionary.

setup()

Sets up the application projetc. To do so, it loads the configuration file and activates the logger objects.