Coretex
coretex.coretex.experiment.status.ExperimentStatus Class Reference

Inherits IntEnum.

Public Member Functions

str defaultMessage (self)
 
bool isFinal (self)
 

Detailed Description

    List of possible Experiment statuses during the Experiment lifetime

Definition at line 21 of file status.py.

Member Function Documentation

◆ defaultMessage()

str coretex.coretex.experiment.status.ExperimentStatus.defaultMessage (   self)
    List of supported statuses:
    - preparingToStart : Experiment preparing to start
    - completedWithSuccess : Experiment is completed without errors
    - completedWithError : Experiment is completed with error
    - stopped : Experiment is stopped manually
    - stopping : Experiment is stopping

    Returns
    -------
    str -> Appropriate message based on Experiment status

    Raises
    ------
    ValueError -> if unsupported status is provided

Definition at line 38 of file status.py.

38  def defaultMessage(self) -> str:
39  """
40  List of supported statuses:
41  - preparingToStart : Experiment preparing to start
42  - completedWithSuccess : Experiment is completed without errors
43  - completedWithError : Experiment is completed with error
44  - stopped : Experiment is stopped manually
45  - stopping : Experiment is stopping
46 
47  Returns
48  -------
49  str -> Appropriate message based on Experiment status
50 
51  Raises
52  ------
53  ValueError -> if unsupported status is provided
54  """
55 
56  if self == ExperimentStatus.preparingToStart:
57  return "Preparing to start the experiment."
58 
59  if self == ExperimentStatus.completedWithSuccess:
60  return "Experiment completed successfully."
61 
62  if self == ExperimentStatus.completedWithError:
63  return "Experiment execution was interrupted due to an error. View experiment console for more details."
64 
65  if self == ExperimentStatus.stopped:
66  return "Experiment execution was stopped by request from the user."
67 
68  if self == ExperimentStatus.stopping:
69  return "Stopping the experiment."
70 
71  raise ValueError(f">> [Coretex] {self.name} has no default message")
72 

◆ isFinal()

bool coretex.coretex.experiment.status.ExperimentStatus.isFinal (   self)
    List of final statuses:
    - ExperimentStatus.completedWithSuccess : Experiment finished without error
    - ExperimentStatus.completedWithError : Experiment finished with an error
    - ExperimentStatus.stopped : Experiment is manually stopped

    Returns
    -------
    bool -> True if a status is a final status for a experiment

Definition at line 74 of file status.py.

74  def isFinal(self) -> bool:
75  """
76  List of final statuses:
77  - ExperimentStatus.completedWithSuccess : Experiment finished without error
78  - ExperimentStatus.completedWithError : Experiment finished with an error
79  - ExperimentStatus.stopped : Experiment is manually stopped
80 
81  Returns
82  -------
83  bool -> True if a status is a final status for a experiment
84  """
85 
86  return (
87  self == ExperimentStatus.completedWithSuccess or
88  self == ExperimentStatus.completedWithError or
89  self == ExperimentStatus.stopped
90  )

The documentation for this class was generated from the following file: