Ejemplo n.º 1
0
    def PMTRAION_MOL(self, val):

        if val is None or utilities.is_list_of_numbers(val):
            self.__changeLog.append({
                "Date": datetime.datetime.now(),
                "Module": "MOL_PROBABILITIES",
                "Variable": "PMTRAION_MOL",
                "Success": True,
                "Previous": self.__PMTRAION_MOL,
                "New": val,
                "ErrorMessage": None,
                "Location": self.__location,
            })
            self.__PMTRAION_MOL = val
        else:
            errorMessage = "Invalid option for PMTRAION_MOL: {}. Must be a list of numbers.".format(
                val)
            self.__changeLog.append({
                "Date": datetime.datetime.now(),
                "Module": "MOL_PROBABILITIES",
                "Variable": "PMTRAION_MOL",
                "Success": False,
                "Previous": self.__PMTRAION_MOL,
                "New": val,
                "ErrorMessage": errorMessage,
                "Location": self.__location,
            })
            self.__errorLog.append({
                "Date": datetime.datetime.now(),
                "Type": "Setter",
                "Module": "MOL_PROBABILITIES",
                "Variable": "PMTRAION_MOL",
                "ErrorMessage": errorMessage,
                "Location": self.__location,
            })
Ejemplo n.º 2
0
 def PBIAS(self, val):
     if utilities.is_list_of_numbers(val) or val is None:
         self.__changeLog.append({
             "Date": datetime.datetime.now(),
             "Module": "AVBMC",
             "Variable": "PBIAS",
             "Success": True,
             "Previous": self.__PBIAS,
             "New": val,
             "ErrorMessage": None,
             "Location": self.__location,
         })
         self.__PBIAS = val
     else:
         errorMessage = (
             "Invalid option for PBIAS: {}. Should be a list of numbers".
             format(val))
         self.__changeLog.append({
             "Date": datetime.datetime.now(),
             "Module": "AVBMC",
             "Variable": "PBIAS",
             "Success": False,
             "Previous": self.__PBIAS,
             "New": val,
             "ErrorMessage": errorMessage,
             "Location": self.__location,
         })
         self.__errorLog.append({
             "Date": datetime.datetime.now(),
             "Type": "Setter",
             "Module": "AVBMC",
             "Variable": "PBIAS",
             "ErrorMessage": errorMessage,
             "Location": self.__location,
         })
Ejemplo n.º 3
0
def _validate_PMROT_MOL(val, errorLog=[]):

    if utilities.is_list_of_numbers(val) or (val is None):
        return val
    else:
        errorMessage = "Invalid option for PMROT_MOL: {}. Valid options are: {}".format(
            val)
        errorLog.append({
            "Date": datetime.datetime.now(),
            "Type": "init",
            "Module": "MOL_PROBABILITIES",
            "Variable": "PMROT_MOL",
            "ErrorMessage": errorMessage,
        })
        raise TypeError
Ejemplo n.º 4
0
def _validate_PBIAS(val, errorLog=[]):

    if utilities.is_list_of_numbers(val) or (val is None):
        return val
    else:
        errorMessage = (
            "Invalid option for PBIAS: {}. It should be a list of numbers.".
            format(val))
        errorLog.append({
            "Date": datetime.datetime.now(),
            "Type": "init",
            "Module": "AVBMC",
            "Variable": "PBIAS",
            "ErrorMessage": errorMessage,
        })
        raise TypeError
def _validate_RMTRANS(val, errorLog=[]):

    if utilities.is_list_of_numbers(val) or (val is None):
        return val
    else:
        errorMessage = (
            "Invalid option for RMTRANS: {}. Must be a list of numbers.".
            format(val))
        errorLog.append({
            "Date": datetime.datetime.now(),
            "Type": "init",
            "Module": "MOL_DISPLACEMENTS",
            "Variable": "RMTRANS",
            "ErrorMessage": errorMessage,
        })
        raise TypeError
def _validate_CENTER_POINT(val, errorLog=[]):

    if utilities.is_list_of_numbers(val) or (val is None):
        return val
    else:
        errorMessage = (
            "Invalid option for CENTER_POINT: {}. Must be a list of  numbers".format(
                val
            )
        )
        errorLog.append(
            {
                "Date": datetime.datetime.now(),
                "Type": "init",
                "Module": "CENTER_COORDINATES",
                "Variable": "CENTER_POINT",
                "ErrorMessage": errorMessage,
            }
        )
        raise TypeError
    def CENTER_POINT(self, val):
        if utilities.is_list_of_numbers(val):

            self.__changeLog.append(
                {
                    "Date": datetime.datetime.now(),
                    "Module": "CENTER_COORDINATES",
                    "Variable": "CENTER_POINT",
                    "Success": True,
                    "Previous": self.__CENTER_POINT,
                    "New": val,
                    "ErrorMessage": None,
                    "Location": self.__location,
                }
            )
            self.__CENTER_POINT = val
        else:
            errorMessage = "Invalid option for CENTER_POINT: {}".format(val)
            self.__changeLog.append(
                {
                    "Date": datetime.datetime.now(),
                    "Module": "CENTER_COORDINATES",
                    "Variable": "CENTER_POINT",
                    "Success": False,
                    "Previous": self.__CENTER_POINT,
                    "New": val,
                    "ErrorMessage": errorMessage,
                    "Location": self.__location,
                }
            )
            self.__errorLog.append(
                {
                    "Date": datetime.datetime.now(),
                    "Type": "Setter",
                    "Module": "CENTER_COORDINATES",
                    "Variable": "CENTER_POINT",
                    "ErrorMessage": errorMessage,
                    "Location": self.__location,
                }
            )
    def RMTRANS(self, val):

        if val is None or utilities.is_list_of_numbers(val):
            self.__changeLog.append({
                "Date": datetime.datetime.now(),
                "Module": "MOL_DISPLACEMENTS",
                "Variable": "RMTRANS",
                "Success": True,
                "Previous": self.__RMTRANS,
                "New": val,
                "ErrorMessage": None,
                "Location": self.__location,
            })
            self.__RMTRANS = val
        else:
            errorMessage = (
                "Invalid option for RMTRANS: {}. Must be a list of numbers".
                format(val))
            self.__changeLog.append({
                "Date": datetime.datetime.now(),
                "Module": "MOL_DISPLACEMENTS",
                "Variable": "RMTRANS",
                "Success": False,
                "Previous": self.__RMTRANS,
                "New": val,
                "ErrorMessage": errorMessage,
                "Location": self.__location,
            })
            self.__errorLog.append({
                "Date": datetime.datetime.now(),
                "Type": "Setter",
                "Module": "MOL_DISPLACEMENTS",
                "Variable": "RMTRANS",
                "ErrorMessage": errorMessage,
                "Location": self.__location,
            })