parse_global_settings

Module Contents

Classes

GlobalSettings

Class that contains the variables of global_settings.py as attributes.

class parse_global_settings.GlobalSettings(root_dir, input_name='')

Class that contains the variables of global_settings.py as attributes.

Attributes will be all that are present in global_settings.py.

Additionally there will be root_dir which is the memorized path of root directory and attempt_handler_obj_file. The latter is the file which is used to serialize the current state of the attempt_handler attribute. IMPORTANT: If you want to start from scratch, you have to remove this file.

Parameters
  • root_dir (str) – Path to the root directory

  • global_settings (str) – Path to the global_settings.py file, relative to root_dir, default “input/global_settings.py”

serialize_attempt_handler(self)

Serializes the attempt_handler object into a binary file.

This function is used to store the state of the attempt_handler object at the end of a run. Such it can be restored when starting a new run.

deserialize_attempt_handler(self)

Deserializes the attempt_handler object from a binary file.

If a file named as attempt_handler_obj_file exists, the attempt_handler object is restore from that. If there is not such a file, nothing is done here and the attempt_handler object is initialized as implemented in its contructor.