TransitionRunThread Class

class ep_transition.transition_run_thread.TransitionRunThread(transitions_to_run: List[TransitionBinary], working_directory: Path, original_file_path: Path, keep_old: bool, ready_callback: Callable, increment_callback: Callable, msg_callback: Callable, done_callback: Callable)

Bases: Thread

This class allows easily running a series of EnergyPlus Transition program versions in a separate thread

Parameters
  • transitions_to_run – A list of TransitionBinary instances

  • working_directory – The transition working directory to run transitions in

  • original_file_path – The absolute file path to the file to be transitioned

  • keep_old – A flag for whether to keep an extra backup of the original file to be transitioned in the run dir

  • msg_callback – A Python function to be called back by this thread when a message can be displayed

  • done_callback – A Python function to be called back by this thread when the transition process is complete

Variables
  • std_out – The standard output from the transition process

  • std_err – The standard error output from the transition process

backup_file_before_transition(transition_instance: TransitionBinary) bool
run()

This function runs the instantiated thread based on the parameters passed into the constructor. The function intermittently calls the msg_callback class instance function variable to alert the calling thread of status updates. When the function is complete it calls the done_callback class instance function variable to alert the calling thread.

stop()

Sets the cancelled flag to attempt to kill the transition at the next step