ticket

Represents a structure to contain directions for how to parse and import genomes into a MySQL database.

class pdm_utils.classes.ticket.ImportTicket

Bases: object

check_attribute(attribute, check_set, expect=False, eval_id=None, success='correct', fail='error', eval_def=None)

Check that the id is valid.

Parameters
  • attribute (str) – Name of the ImportTicket object attribute to evaluate.

  • check_set (set) – Set of reference ids.

  • expect (bool) – Indicates whether the attribute value is expected to be present in the check set.

  • eval_id (str) – Unique identifier for the evaluation.

  • success (str) – Default status if the outcome is a success.

  • fail (str) – Default status if the outcome is not a success.

  • eval_def (str) – Description of the evaluation.

check_compatible_type_and_data_retain(eval_id=None, success='correct', fail='error', eval_def=None)

Check if the ticket type and data_retain are compatible.

If the ticket type is ‘add’, then the data_retain set is not expected to have any data.

Parameters
  • eval_id – same as for check_attribute().

  • success – same as for check_attribute().

  • fail – same as for check_attribute().

  • eval_def – same as for check_attribute().

check_eval_flags(expect=True, eval_id=None, success='correct', fail='error', eval_def=None)

Check that the eval_flags is valid.

Parameters
  • expect (bool) – Indicates whether the eval_flags is expected to contain data.

  • eval_id – same as for check_attribute().

  • success – same as for check_attribute().

  • fail – same as for check_attribute().

  • eval_def – same as for check_attribute().

check_valid_data_source(ref_set_attr, check_set, eval_id=None, success='correct', fail='error', eval_def=None)

Check that the values in the specified attribute are valid.

Parameters
  • ref_set_attr (str) – Name of the data_dict in the ticket to be evaluated (data_add, data_retain, data_retrieve, data_parse)

  • check_set (set) – Set of valid field names.

  • eval_id – same as for check_attribute().

  • success – same as for check_attribute().

  • fail – same as for check_attribute().

  • eval_def – same as for check_attribute().

set_description_field(value)

Set the description_field.

Parameters

value (str) – Value to be set as the description_field.

set_eval(eval_id, definition, result, status)

Constructs and adds an Evaluation object to the evaluations list.

Parameters
  • eval_id (str) – Unique identifier for the evaluation.

  • definition (str) – Description of the evaluation.

  • result (str) – Description of the outcome of the evaluation.

  • status (str) – Outcome of the evaluation.

set_eval_mode(value)

Set the eval_mode.

Parameters

value (str) – Value to be set as the eval_mode.

set_type(value)

Set the ticket type.

Parameters

value (str) – Value to be set as the type.