コード例 #1
0
    def _check_data(self):
        self.valid_data = False

        if self.data is None:
            # Remove trust alert is there is not rating data
            self.warning(self.MISSING_DATA_WARNING)

        else:
            try:   # Check ratings data
                valid_ratings = format_data.check_data(self.data)
            except Exception as e:
                valid_ratings = False
                print('Error checking trust data: ' + str(e))

            if not valid_ratings:  # Check if it's valid
                self.Error.data_error(
                    "Data not valid for rating models.")
            else:
                # Check trust data
                if self.trust is None:
                    self.warning(self.MISSING_DATA_WARNING,
                                 "Trust data input is needed.")
                else:
                    self.warning(self.MISSING_DATA_WARNING)

                    try:  # Check trust data
                        valid_trust = format_data.check_data(self.trust)
                    except Exception as e:
                        valid_trust = False
                        print('Error checking rating data: ' + str(e))

                    if not valid_trust:  # Check if it's valid
                        self.Error.data_error(
                            "Trust data not valid for rating models.")
                    else:
                        self.valid_data = True
        return self.valid_data
コード例 #2
0
    def _check_data(self):
        self.valid_data = False

        if self.data is None:
            # Remove trust alert is there is not rating data
            self.warning(self.MISSING_DATA_WARNING)

        else:
            try:  # Check ratings data
                valid_ratings = format_data.check_data(self.data)
            except Exception as e:
                valid_ratings = False
                print('Error checking trust data: ' + str(e))

            if not valid_ratings:  # Check if it's valid
                self.Error.data_error("Data not valid for rating models.")
            else:
                # Check trust data
                if self.trust is None:
                    self.warning(self.MISSING_DATA_WARNING,
                                 "Trust data input is needed.")
                else:
                    self.warning(self.MISSING_DATA_WARNING)

                    try:  # Check trust data
                        valid_trust = format_data.check_data(self.trust)
                    except Exception as e:
                        valid_trust = False
                        print('Error checking rating data: ' + str(e))

                    if not valid_trust:  # Check if it's valid
                        self.Error.data_error(
                            "Trust data not valid for rating models.")
                    else:
                        self.valid_data = True
        return self.valid_data
コード例 #3
0
    def _check_data(self):
        self.valid_data = False

        if self.data is not None:
            try:  # Check ratings data
                valid_ratings = format_data.check_data(self.data)
            except Exception as e:
                valid_ratings = False
                print('Error checking rating data: ' + str(e))

            if not valid_ratings:  # Check if it's valid
                self.Error.data_error("Data not valid for rating models.")
            else:
                self.valid_data = True

        return self.valid_data
コード例 #4
0
    def _check_data(self):
        self.valid_data = False

        if self.data is not None:
            try:  # Check ratings data
                valid_ratings = format_data.check_data(self.data)
            except Exception as e:
                valid_ratings = False
                print('Error checking rating data: ' + str(e))

            if not valid_ratings:  # Check if it's valid
                self.Error.data_error(
                    "Data not valid for rating models.")
            else:
                self.valid_data = True

        return self.valid_data