Param

This is the main class which interact with the database to get and manage parameter sets. The Param class links all the other classes together enabling a paramater set to be run

Database

In order to get the paramaters, the Param class needs to be given a Database instance (e.g. Sheets or Delimited_file). Regardless of the which database option is used, it must be set up in a particular way as shown below.

Fields

A field is the key (or identifier) used to get the value when a parameter set is returned. Each database is required to have and id and status field. There are many optional fields which can be used to give additionally information about the run such as start time and who performed the run. Below are the fields that are used with parsing parameter sets. Required parameters are marked with an astrict(*).

Fields Description
id* (str) Unique parameter set installed
status* (str) The current status of the parameter set. Blank values are unran (default), finished have finished and failed have failed.
start-time (str) The time that the parameter set began. Times are in UTC time format.
end-time (str) The time that the parameter set finished. Times are in UTC time format.
performed-by (str) The username of the person that ran the parameter set.
comments (str) Any comments such as error messages relating to the parameter set.
class dapt.param.Param(database, config=None)

Create a Param instance with a database and optional config file.

Parameters:
  • database (Database) – a Database instance (such as Sheets or Delimited_file)
  • config (Config) – a config object which allows for more features. This is optional.
failed(id, err='')

Mark a parameter set as failed to completed.

Parameters:
  • id (str) – the id of the parameter set to use
  • err (str) – the error message. Empty by default.
Returns:

The new parameter set that has been updated or False if not able to update.

next_parameters()

Get the next parameter set if one exists

Returns:An OrderedDict containing the key-value pairs from that parameter set or None if there are no more to sets.
successful(id)

Mark a parameter set as successfully completed.

Parameters:id (str) – the id of the parameter set to use
Returns:The new parameter set that has been updated or False if not able to update.
update_status(id, status)

Update the status of the selected parameter. If status is not included in the parameter set keys then nothing will be updated.

Parameters:id (str) – the id of the parameter set to use
Returns:The new parameter set that has been updated or False if not able to update.