Ejemplo n.º 1
0
    def score_and_explain(self, project):
        """Compute the score of given project and why it's scored."""

        # TODO(guillaume): Get the score for each project from lbf.
        all_trainings = project.get_trainings()

        if not all_trainings:
            return NULL_EXPLAINED_SCORE

        search_length = round(project.get_search_length_at_creation())
        if len(all_trainings) >= 2:
            if search_length >= 3:
                return ExplainedScore(3, [
                    project.translate_string(
                        'vous cherchez depuis {} mois').format(search_length)
                ])
            if project.details.kind == project_pb2.REORIENTATION >= 3:
                return ExplainedScore(3, [
                    project.translate_string('vous souhaitez vous réorienter')
                ])
        if search_length >= 2:
            return ExplainedScore(2, [
                project.translate_string(
                    'vous cherchez depuis {} mois').format(search_length)
            ])

        return ExplainedScore(1, [])
Ejemplo n.º 2
0
    def score_and_explain(self, project):
        """Compute a score for the given ScoringProject."""

        if project.job_group_info(
        ).preferred_application_medium == job_pb2.APPLY_IN_PERSON:
            return NULL_EXPLAINED_SCORE
        if user_pb2.NO_OFFER_ANSWERS in project.user_profile.frustrations:
            return ExplainedScore(2, [
                project.translate_string(
                    'vous nous avez dit ne pas avoir assez de réponses des recruteurs'
                )
            ])
        return ExplainedScore(1, [])
Ejemplo n.º 3
0
    def score_and_explain(self, project):
        """Compute a score for the given ScoringProject."""

        is_frustrated_by_trainings = user_pb2.TRAINING in project.user_profile.frustrations
        has_experience = project.details.seniority in set(
            [project_pb2.SENIOR, project_pb2.EXPERT])
        thinks_xp_covers_diplomas = \
            project.details.training_fulfillment_estimate == project_pb2.ENOUGH_EXPERIENCE

        does_not_have_required_diplomas = \
            project.details.training_fulfillment_estimate in set([
                project_pb2.ENOUGH_EXPERIENCE,
                project_pb2.TRAINING_FULFILLMENT_NOT_SURE,
                project_pb2.CURRENTLY_IN_TRAINING])

        if project.details.training_fulfillment_estimate == project_pb2.ENOUGH_DIPLOMAS:
            return NULL_EXPLAINED_SCORE

        reasons = []
        if has_experience:
            reasons.append(
                project.translate_string(
                    "vous nous avez dit avoir de l'expérience"))
        if is_frustrated_by_trainings:
            reasons.append(
                project.translate_string(
                    'vous nous avez dit avoir du mal à accéder à une formation'
                ))
        if thinks_xp_covers_diplomas:
            reasons.append(
                project.translate_string(
                    'vous nous avez dit ne pas avoir les diplômes mais avoir '
                    "l'expérience demandée"))
        if not thinks_xp_covers_diplomas and does_not_have_required_diplomas:
            reasons.append(
                project.translate_string(
                    'vous nous avez dit ne pas avoir les diplômes demandés'))

        if thinks_xp_covers_diplomas:
            if is_frustrated_by_trainings or has_experience:
                return ExplainedScore(3, reasons)
            return ExplainedScore(2, reasons)

        if has_experience and (does_not_have_required_diplomas
                               or is_frustrated_by_trainings):
            return ExplainedScore(2, reasons)

        return NULL_EXPLAINED_SCORE
Ejemplo n.º 4
0
    def score_and_explain(self, project):
        """Compute a score for the given ScoringProject."""

        _related_frustrations = {
            user_pb2.INTERVIEW:
            project.translate_string(
                'vous nous avez dit que les entretiens sont un challenge pour vous'
            ),
            user_pb2.SELF_CONFIDENCE:
            project.translate_string(
                'vous nous avez dit parfois manquer de confiance en vous'),
            user_pb2.ATYPIC_PROFILE:
            project.translate_string(
                'vous nous avez dit ne pas rentrer dans les cases des recruteurs'
            ),
        }

        reasons = [
            _related_frustrations[frustration]
            for frustration in project.user_profile.frustrations
            if frustration in _related_frustrations
        ]
        return ExplainedScore(
            2 if reasons else 1, reasons if reasons else [
                project.translate_string(
                    'vous pouvez toujours vous mettre plus en valeur')
            ])
Ejemplo n.º 5
0
    def score_and_explain(self, project):
        """Compute a score for the given ScoringProject."""

        if project.details.weekly_applications_estimate == project_pb2.DECENT_AMOUNT or \
                project.details.weekly_applications_estimate == project_pb2.A_LOT:
            return ExplainedScore(3, [
                project.translate_string(
                    'vous nous avez dit envoyer beaucoup de candidatures')
            ])
        return NULL_EXPLAINED_SCORE
Ejemplo n.º 6
0
    def score_and_explain(self, project):
        """Compute a score for the given ScoringProject."""

        if project.user_profile.has_handicap:
            return NULL_EXPLAINED_SCORE

        if project.get_search_length_at_creation() > 3:
            return ExplainedScore(1, [])

        return NULL_EXPLAINED_SCORE
Ejemplo n.º 7
0
    def score_and_explain(self, project):
        """Compute a score for the given ScoringProject."""

        age = project.get_user_age()
        reasons = []
        if (user_pb2.AGE_DISCRIMINATION in project.user_profile.frustrations
                and age > 40):
            reasons.append(
                project.translate_string(
                    'vous nous avez dit que votre age pouvait parfois être un '
                    + 'obstacle'))
        if reasons or age >= 45:
            return ExplainedScore(2, reasons)
        return NULL_EXPLAINED_SCORE
Ejemplo n.º 8
0
    def score_and_explain(self, project):
        """Compute a score for the given ScoringProject."""

        if project.specific_to_job_advice_config():
            return ExplainedScore(3, [])
        return NULL_EXPLAINED_SCORE