def isolute(self, val): if ti.is_positive_integer(val): self.__changeLog.append({ 'Date': datetime.datetime.now(), 'Location': self.__location, 'Variable': 'isolute', 'Success': True, 'Previous': self.__isolute, 'New': val, 'ErrorMessage': None }) self.__isolute = val else: errorMessage = "isolute must be a positive integer." self.__changeLog.append({ 'Date': datetime.datetime.now(), 'Location': self.__location, 'Variable': 'isolute', 'Success': False, 'Previous': self.__isolute, 'New': val, 'ErrorMessage': errorMessage }) self.__errorLog.append({ 'Date': datetime.datetime.now(), 'Type': 'Setter', 'Location': self.__location, 'Variable': 'isolute', 'ErrorMessage': errorMessage })
def checkpoint_copies(self, val): if ti.is_positive_integer(val): self.__changeLog.append({ 'Date': datetime.datetime.now(), 'Location': self.__location, 'Variable': 'checkpoint_copies', 'Success': True, 'Previous': self.__checkpoint_copies, 'New': val, 'ErrorMessage': None }) self.__checkpoint_copies = val else: errorMessage = "checkpoint_copies must be an integer." self.__changeLog.append({ 'Date': datetime.datetime.now(), 'Location': self.__location, 'Variable': 'checkpoint_copies', 'Success': False, 'Previous': self.__checkpoint_copies, 'New': val, 'ErrorMessage': None }) self.__errorLog.append({ 'Date': datetime.datetime.now(), 'Type': 'Setter', 'Location': self.__location, 'Variable': 'checkpoint_copies', 'ErrorMessage': errorMessage })
def nchoiq(self, val): var = "nchoiq" if not isinstance(val, oda.oneDimArray): if not (isinstance(val, list) or ti.is_positive_integer(val)): errorMessage = logging.multidimensional_error("nchoiq", False) self.__changeLog.append( logging.changelog_entry(self.__location, "nchoiq", False, repr(getattr(self, "nchoiq")), repr(val), errorMessage)) self.__errorLog.append( logging.errorlog_entry("Setter", errorMessage)) else: if not isinstance(val, list): val = [val] myODA = oda.oneDimArray.listToODA(val, errorLog=self.__errorLog, changeLog=self.__changeLog, location=self.__location, var=var) self.__changeLog.append( logging.changelog_entry(self.__location, "nchoiq", False, repr(getattr(self, "nchoiq")), repr(val), None)) self.__nchoiq = myODA else: self.__changeLog.append( logging.changelog_entry(self.__location, "nchoiq", False, repr(getattr(self, "nchoiq")), repr(val), None)) self.__nchoiq = val
def nThreadsPerProc(self, val): if ti.is_positive_integer(val): self.__changeLog.append({ 'Date': datetime.datetime.now(), 'Location': self.__location, 'Variable': 'nThreadsPerProc', 'Success': True, 'Previous': self.__nThreadsPerProc, 'New': val, 'ErrorMessage': None }) self.__nThreadPerProc = val else: errorMessage = "nThreadsPerProc must be a positive integer." self.__errorLog.append({ 'Date': datetime.datetime.now(), 'Type': 'Setter', 'Location': self.__location, 'Variable': 'nThreadsPerProc', 'ErrorMessage': errorMessage }) self.__changeLog.append({ 'Date': datetime.datetime.now(), 'Location': self.__location, 'Variable': 'nThreadsPerProc', 'Success': False, 'Previous': self.__nThreadsPerProc, 'New': val, 'ErrorMessage': errorMessage })
def ndumph(self, val): if not ti.is_positive_integer(val): errorMessage = "ndumph failed test_instance.is_positive_integer check." self.__changeLog.append( logging.changelog_entry(self.__location, "ndumph", False, repr(getattr(self, "ndumph")), repr(val), errorMessage)) self.__errorLog.append( logging.errorlog_entry("Setter", errorMessage)) else: self.__changeLog.append( logging.changelog_entry(self.__location, "ndumph", False, repr(getattr(self, "ndumph")), repr(val), None)) self.__ndumph = val