def YOSHIDA(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "NOSE", "Variable": "YOSHIDA", "Success": True, "Previous": self.__YOSHIDA, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__YOSHIDA = val else: errorMessage = "Nose YOSHIDA integrator order must be a positive integer." self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "NOSE", "Variable": "YOSHIDA", "ErrorMessage": errorMessage, "Location": self.__location, }) self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "NOSE", "Variable": "YOSHIDA", "Success": False, "Previous": self.__YOSHIDA, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, })
def BACKUP_COPIES(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "PRINT / RESTART", "Variable": "BACKUP_COPIES", "Success": True, "Previous": self.__BACKUP_COPIES, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__BACKUP_COPIES = val else: errorMessage = "BACKUP_COPIES must be a positive integer." self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "PRINT / RESTART", "Variable": "BACKUP_COPIES", "Success": False, "Previous": self.__BACKUP_COPIES, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, }) self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "PRINT / RESTART", "Variable": "BACKUP_COPIES", "ErrorMessage": errorMessage, "Location": self.__location, })
def MAX_ELEMENTS_PER_BLOCK(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "DBCSR", "Variable": "MAX_ELEMENTS_PER_BLOCK", "Success": True, "Previous": self.__MAX_ELEMENTS_PER_BLOCK, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__MAX_ELEMENTS_PER_BLOCK = val else: errorMessage = "MAX_ELEMENTS_PER_BLOCK must be a positive integer. You passed {}.".format( val) self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "DBCSR", "Variable": "MAX_ELEMENTS_PER_BLOCK", "Success": False, "Previous": self.__COMM_THREAD_LOAD, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, }) self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "DBCSR", "Variable": "MAX_ELEMENTS_PER_BLOCK", "ErrorMessage": errorMessage, "Location": self.__location, })
def MTS(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "NOSE", "Variable": "MTS", "Success": True, "Previous": self.__MTS, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__MTS = val else: errorMessage = ( "Nose number of multiple time steps (MTS) must be a positive integer." ) self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "NOSE", "Variable": "MTS", "Success": False, "Previous": self.__MTS, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, }) self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "NOSE", "Variable": "MTS", "ErrorMessage": errorMessage, "Location": self.__location, })
def COMMON_ITERATION_LEVELS(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "PRINT / VELOCITIES", "Variable": "COMMON_ITERATION_LEVELS", "Success": True, "Previous": self.__COMMON_ITERATION_LEVELS, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__COMMON_ITERATION_LEVELS = val else: errorMessage = "COMMON_ITERATION_LEVELS must be a positive integer." self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "PRINT / VELOCITIES", "Variable": "COMMON_ITERATION_LEVELS", "Success": False, "Previous": self.__COMMON_ITERATION_LEVELS, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, }) self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "PRINT / VELOCITIES", "Variable": "COMMON_ITERATION_LEVELS", "ErrorMessage": errorMessage, "Location": self.__location, })
def SPLINE_FIND_COEFFS(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "EACH", "Variable": "SPLINE_FIND_COEFFS", "Success": True, "Previous": self.__SPLINE_FIND_COEFFS, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__SPLINE_FIND_COEFFS = val else: errorMessage = ( "SPLINE_FIND_COEFFS iteration level must be a positive integer." ) self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "EACH", "Variable": "SPLINE_FIND_COEFFS", "Success": False, "Previous": self.__SHELL_OPT, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, }) self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "EACH", "Variable": "SPLINE_FIND_COEFFS", "ErrorMessage": errorMessage, "Location": self.__location, })
def XAS_SCF(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "EACH", "Variable": "XAS_SCF", "Success": True, "Previous": self.__XAS_SCF, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__XAS_SCF = val else: errorMessage = "XAS_SCF iteration level must be a positive integer." self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "EACH", "Variable": "XAS_SCF", "Success": False, "Previous": self.__XAS_SCF, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, }) self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "EACH", "Variable": "XAS_SCF", "ErrorMessage": errorMessage, "Location": self.__location, })
def NCOL_BLOCKS(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "DBCSR", "Variable": "NCOL_BLOCKS", "Success": True, "Previous": self.__NCOL_BLOCKS, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__NCOL_BLOCKS = val else: errorMessage = ( "NCOL_BLOCKS must be a positive integer. You passed {}.". format(val)) self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "DBCSR", "Variable": "NCOL_BLOCKS", "Success": False, "Previous": self.__NCOL_BLOCKS, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, }) self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "DBCSR", "Variable": "NCOL_BLOCKS", "ErrorMessage": errorMessage, "Location": self.__location, })
def STEP_START_VAL(self, val): if utilities.is_positive_integer(val): self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "GEO_OPT", "Variable": "STEP_START_VAL", "Success": True, "Previous": self.__STEP_START_VAL, "New": val, "ErrorMessage": None, "Location": self.__location, }) self.__STEP_START_VAL = val else: errorMessage = "STEP_START_VAL must be a positive integer." self.__changeLog.append({ "Date": datetime.datetime.now(), "Module": "GEO_OPT", "Variable": "STEP_START_VAL", "Success": False, "Previous": self.__STEP_START_VAL, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, }) self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "Setter", "Module": "GEO_OPT", "Variable": "STEP_START_VAL", "ErrorMessage": errorMessage, "Location": self.__location, })
def _validate_md(val, errorLog=[]): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "MD iteration level must be a positive integer." errorLog.append({ "Date": datetime.datetime.now(), "Type": "init", "Module": "EACH", "Variable": "MD", "ErrorMessage": errorMessage, }) raise TypeError
def _validate_spline_find_coeffs(val, errorLog=[]): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "SPLINE_FIND_COEFFS iteration level must be a positive integer." errorLog.append({ "Date": datetime.datetime.now(), "Type": "init", "Module": "EACH", "Variable": "SPLINE_FIND_COEFFS", "ErrorMessage": errorMessage, }) raise TypeError
def _validate_mts(val): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "Nose MTS must be a positive number." self.__errorLog.append({ "Date": datetime.datetime.now(), "Type": "init", "Module": "NOSE", "Variable": "YOSHIDA", "ErrorMessage": errorMessage, }) raise TypeError
def _validate_COMMON_ITERATION_LEVELS(val, errorLog=[]): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "COMMON_ITERATION_LEVELS level must be a positive integer." errorLog.append({ "Date": datetime.datetime.now(), "Type": "init", "Module": "PRINT / RESTART", "Variable": "COMMON_ITERATION_LEVELS", "ErrorMessage": errorMessage, }) raise TypeError
def _validate_steps(val, errorLog=[]): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "MD STEPS must be an integer." errorLog.append({ "Date": datetime.datetime.now(), "Type": "init", "Module": "MD", "Variable": "STEPS", "ErrorMessage": errorMessage, }) raise TypeError
def _validate_BACKUP_COPIES(val, errorLog=[]): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "BACKUP_COPIES must be a positive integer." errorLog.append({ "Date": datetime.datetime.now(), "Type": "init", "Module": "PRINT / RESTART", "Variable": "BACKUP_COPIES", "ErrorMessage": errorMessage, }) raise TypeError
def _validate_a_scale(val): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "scaling factor for matrix A (for generic matrix A, depends on the characteristic frequency of the system). must be a positive integer." self.__errorLog.append( { "Date": datetime.datetime.now(), "Type": "init", "Module": "GLE", "Variable": "A_SCALE", "ErrorMessage": errorMessage, } ) raise TypeError
def _validate_MAX_ITER(val, errorLog=[]): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "GEO_OPT MAX_ITER must be an integer." errorLog.append({ "Date": datetime.datetime.now(), "Type": "init", "Module": "GEO_OPT", "Variable": "MAX_ITER", "ErrorMessage": errorMessage, }) raise TypeError return val
def _validate_STRIDE(val, errorLog=[]): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = "STRIDE level must be a positive integer." errorLog.append( { "Date": datetime.datetime.now(), "Type": "init", "Module": "FORCE_EVAL/DFT/PRINT/E_DENSITY_CUBE", "Variable": "STRIDE", "ErrorMessage": errorMessage, } ) raise TypeError
def _validate_ndim(val): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = ( "GLE NDIM {Integer} Size of the gle matrix must be a positive number." ) self.__errorLog.append( { "Date": datetime.datetime.now(), "Type": "init", "Module": "GLE", "Variable": "NDIM", "ErrorMessage": errorMessage, } ) raise TypeError
def _validate_STEP_START_VAL(val, errorLog=[]): if utilities.is_positive_integer(val) or (val is None): return val else: errorMessage = ( "The starting step value for the GEO_OPT module must be an integer." ) errorLog.append({ "Date": datetime.datetime.now(), "Type": "init", "Module": "GEO_OPT", "Variable": "STEP_START_VAL", "ErrorMessage": errorMessage, }) raise TypeError return val
def STRIDE(self, val): if utilities.is_positive_integer(val): self.__changeLog.append( { "Date": datetime.datetime.now(), "Module": "FORCE_EVAL/DFT/PRINT/E_DENSITY_CUBE", "Variable": "STRIDE", "Success": True, "Previous": self.__STRIDE, "New": val, "ErrorMessage": None, "Location": self.__location, } ) self.__STRIDE = val else: errorMessage = "COMMON_ITERATION_LEVELS must be a positive integer." self.__changeLog.append( { "Date": datetime.datetime.now(), "Module": "FORCE_EVAL/DFT/PRINT/E_DENSITY_CUBE", "Variable": "STRIDE", "Success": False, "Previous": self.__STRIDE, "New": val, "ErrorMessage": errorMessage, "Location": self.__location, } ) self.__errorLog.append( { "Date": datetime.datetime.now(), "Type": "Setter", "Module": "FORCE_EVAL/DFT/PRINT/E_DENSITY_CUBE", "Variable": "STRIDE", "ErrorMessage": errorMessage, "Location": self.__location, } )