def updateMessages(self, parameters):
        """Modify the messages created by internal validation for each tool
        parameter.  This method is called after internal validation."""

        input_parameter = parameters[0]
        variable_parameter = parameters[1]
        dimension_parameter = parameters[2]
        output_parameter = parameters[3]
        output_var_parameter = parameters[4]
        type_parameter = parameters[5]
        dataset = None

        # Open dataset and populate variable names
        if input_parameter.value is not None:
            try:
                dataset = mds.netcdf.Dataset(input_parameter.valueAsText, '')
            except __HOLE__, exception:
                if "No such file or directory" in str(exception) or \
                    "Invalid argument" in str(exception):
                    input_parameter.setErrorMessage(
                        mds.messages.INPUT_DATASET_DOES_NOT_RESOLVE_TO_FILENAME.format(
                            input_parameter.valueAsText))
                elif "Malformed or inaccessible DAP DDS" in str(exception):
                    input_parameter.setErrorMessage(
                        mds.messages.INPUT_DATASET_URL_MALFORMED.format(
                            input_parameter.valueAsText))
                else:
                    input_parameter.setErrorMessage(
                        mds.messages.INPUT_DATASET_GENERIC_ERROR.format(
                            input_parameter.valueAsText, str(exception)))
            except Exception, exception:
                input_parameter.setErrorMessage(
                    mds.messages.INPUT_DATASET_GENERIC_ERROR.format(
                        input_parameter.valueAsText, str(exception)))
            if dataset is not None:
                # Fill variable list
                variable_parameter.filter.type = "ValueList"
                variable_parameter.filter.list = list(dataset.variable_names())
        else:
            # Clear variable list if no input specified
            variable_parameter.filter.type = "ValueList"
            variable_parameter.filter.list = []
            variable_parameter.value = ""
            # Clear dimension list if no input specified
            dimension_parameter.filter.type = "ValueList"
            dimension_parameter.filter.list = []
            dimension_parameter.value = ""

        # Update dimension list
        if (variable_parameter.value is not None) and (dataset is not None):
            # Fill dimensions list
            dimension_parameter.filter.type = "ValueList"
            dimension_parameter.filter.list = list(
                dataset.variable_dimension_names(variable_parameter.valueAsText))
        else:
            # Clear dimension list if no input specified
            dimension_parameter.filter.type = "ValueList"
            dimension_parameter.filter.list = []
            dimension_parameter.value = ""

        # Ensure an output variable name is entered
        if (output_var_parameter.altered) and (output_var_parameter.value is None):
            output_var_parameter.setErrorMessage(
                '%s: Must input a variable name.' % output_var_parameter.name)

        # Ensure output variable name is not the same as an existing variable's
        if (output_var_parameter.value is not None) and \
            (dataset is not None) and (output_var_parameter.value in \
            dataset.variable_names()):
            output_var_parameter.setErrorMessage(
                '%s: Name cannot be the same as that of an existing variable.' \
                % output_var_parameter.name)

        # Populate a default output variable name and update it with changes
        #   to other parameters as long as the user hasn't modified it themself
        if (variable_parameter.value is not None) and \
            (dimension_parameter.value is not None) and \
            (not output_var_parameter.altered):
            if type_parameter.value is None:
                output_var_parameter.value = variable_parameter.value + \
                    "_MEAN" + dimension_parameter.value
            else:
                output_var_parameter.value = variable_parameter.value + \
                    "_" + type_parameter.value + dimension_parameter.value

        # Ensure output file has a .nc extension
        if output_parameter.value is not None:
            output_filename = output_parameter.valueAsText
            if os.path.splitext(output_filename)[1] != ".nc":
                output_parameter.setErrorMessage(
                    mds.messages.OUTPUT_FILE_EXTENSION_MUST_BE_NC)

        return

    # ---------------------------------------------------------
    # Statistics
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/tools/get_variable_statistics_over_dimension.py/GetVariableStatisticsOverDimension.updateMessages