diff --git a/migrator/services/migrate_questions.py b/migrator/services/migrate_questions.py index 60a43cf1a8..8604ee8ed8 100644 --- a/migrator/services/migrate_questions.py +++ b/migrator/services/migrate_questions.py @@ -73,7 +73,7 @@ def create_question(question: dict, **kwargs) -> Question: created_at=question["created_time"], edited_at=question["edited_time"], open_time=question["publish_time"], - cp_reveal_time=question["publish_time"], + cp_reveal_time=question["cp_reveal_time"], scheduled_close_time=( question["close_time"] if question["close_time"] diff --git a/migrator/services/migrate_scoring.py b/migrator/services/migrate_scoring.py index f45657d305..1a6dc39e8c 100644 --- a/migrator/services/migrate_scoring.py +++ b/migrator/services/migrate_scoring.py @@ -88,51 +88,29 @@ def score_questions(qty: int | None = None, start_id: int = 0): ) print("Resolved q with no resolved time") exit() + score_types = [ + Score.ScoreTypes.PEER, + Score.ScoreTypes.BASELINE, + Score.ScoreTypes.SPOT_PEER, + ] + if question.id in question_ids_to_relative_score: + score_types.append(Score.ScoreTypes.RELATIVE_LEGACY) f = question.user_forecasts.count() print( f"\033[Kscoring question {i:>4}/{c} ID:{question.id:<4} forecasts:{f:<4} " f"dur:{str(timezone.now() - start).split(".")[0]} " f"est:{str((timezone.now() - start) / i * c).split(".")[0]} " - "peer...", + f"scoring: {','.join(score_types)}...", end="\r", ) score_question( question, question.resolution, - score_types=[ - Score.ScoreTypes.PEER, - ], + score_types=score_types, ) - print( - f"\033[Kscoring question {i:>4}/{c} ID:{question.id:<4} forecasts:{f:<4} " - f"dur:{str(timezone.now() - start).split(".")[0]} " - f"est:{str((timezone.now() - start) / i * c).split(".")[0]} " - "peer done. basline...", - end="\r", - ) - score_question( - question, - question.resolution, - score_types=[ - Score.ScoreTypes.BASELINE, - ], - ) - # TODO: add spot_forecast_time - if question.id in question_ids_to_relative_score: - if ArchivedScore.objects.filter(question=question).exists(): - continue - print( - f"\033[Kscoring question {i:>4}/{c} ID:{question.id:<4} forecasts:{f:<4} " - f"dur:{str(timezone.now() - start).split(".")[0]} " - f"est:{str((timezone.now() - start) / i * c).split(".")[0]} " - "peer done. basline done. relative...", - end="\r", - ) - score_question( - question, - question.resolution, - # TODO: add spot_forecast_time - score_types=[ - Score.ScoreTypes.RELATIVE_LEGACY, - ], - ) + print( + f"\033[Kscoring question {i:>4}/{c} ID:{question.id:<4} forecasts:{f:<4} " + f"dur:{str(timezone.now() - start).split(".")[0]} " + f"est:{str((timezone.now() - start) / i * (c - i)).split(".")[0]} " + f"scoring: {','.join(score_types)}... DONE", + ) diff --git a/questions/tasks.py b/questions/tasks.py index 0fd7169475..32a20cd04a 100644 --- a/questions/tasks.py +++ b/questions/tasks.py @@ -35,7 +35,12 @@ def resolve_question_and_send_notifications(question_id: int): score_question( question, question.resolution, - score_types=[Score.ScoreTypes.PEER, Score.ScoreTypes.BASELINE], + score_types=[ + Score.ScoreTypes.PEER, + Score.ScoreTypes.BASELINE, + Score.ScoreTypes.SPOT_PEER, + Score.ScoreTypes.RELATIVE_LEGACY, + ], ) scores = ( question.scores.filter(user__isnull=False)