8000 Remove deprecated fields by jmsmkn · Pull Request #4063 · comic/grand-challenge.org · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove deprecated fields #4063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally se 8000 nd you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.21 on 2025-06-02 17:32

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
(
"algorithms",
"0074_algorithmimageuserobjectpermission_algorithms__user_id_ba5ee9_idx_and_more",
),
]

operations = [
migrations.RemoveField(
model_name="job",
name="completed_at",
),
migrations.RemoveField(
model_name="job",
name="compute_cost_euro_millicents",
),
migrations.RemoveField(
model_name="job",
name="started_at",
),
]
10 changes: 0 additions & 10 deletions app/grandchallenge/components/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1655,16 +1655,6 @@ class ComponentJob(FieldChangeMixin, UUIDModel):
runtime_metrics = models.JSONField(default=dict, editable=False)
error_message = models.CharField(max_length=1024, default="")
detailed_error_message = models.JSONField(blank=True, default=dict)
started_at = models.DateTimeField(null=True)
completed_at = models.DateTimeField(null=True)
compute_cost_euro_millicents = models.PositiveIntegerField(
# We store euro here as the costs were incurred at a time when
# the exchange rate may have been different
editable=False,
null=True,
default=None,
help_text="The total compute cost for this job in Euro Cents, including Tax",
)
input_prefixes = models.JSONField(
default=dict,
editable=False,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.21 on 2025-06-02 17:32

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
(
"evaluation",
"0087_evaluationgroundtruthuserobjectpermission_evaluation__user_id_3b94cc_idx_and_more",
),
]

operations = [
migrations.RemoveField(
model_name="evaluation",
name="completed_at",
),
migrations.RemoveField(
model_name="evaluation",
name="compute_cost_euro_millicents",
),
migrations.RemoveField(
model_name="evaluation",
name="started_at",
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ def create_evaluation_utilizations(apps, schema_editor):
evaluations_to_create = []
n_created = 0

if not Evaluation.objects.exists():
return

for evaluation in (
Evaluation.objects.filter(evaluation_utilization__isnull=True)
.only(
Expand Down Expand Up @@ -72,6 +75,9 @@ def create_job_utilizations(apps, schema_editor):
job_utlizations_to_create = []
n_created = 0

if not Job.objects.exists():
return

for job in (
Job.objects.filter(job_utilization__isnull=True)
.only(
Expand Down Expand Up @@ -120,20 +126,21 @@ def set_challenges_to_job_utilizations(apps, schema_editor):
Permission = apps.get_model("auth", "Permission") # noqa: N806
Challenge = apps.get_model("challenges", "Challenge") # noqa: N806

challenges = Challenge.objects.all()
if not Challenge.objects.exists():
return

if challenges.exists():
permission = Permission.objects.get(
codename="view_job",
content_type__app_label="algorithms",
content_type__model="job",
)
for challenge in challenges:
job_utilizations = JobUtilization.objects.filter(
job__jobgroupobje 8AC4 ctpermission__group=challenge.admins_group,
job__jobgroupobjectpermission__permission=permission,
).distinct()
job_utilizations.update(challenge=challenge)
permission = Permission.objects.get(
codename="view_job",
content_type__app_label="algorithms",
content_type__model="job",
)

for challenge in Challenge.objects.all():
job_utilizations = JobUtilization.objects.filter(
job__jobgroupobjectpermission__group=challenge.admins_group,
job__jobgroupobjectpermission__permission=permission,
).distinct()
job_utilizations.update(challenge=challenge)


def set_phases_and_archive_to_job_utilizations(apps, schema_editor):
Expand All @@ -142,6 +149,9 @@ def set_phases_and_archive_to_job_utilizations(apps, schema_editor):
)
Phase = apps.get_model("evaluation", "Phase") # noqa: N806

if not Phase.objects.exists():
return

for phase in Phase.objects.all():
job_utilizations = JobUtilization.objects.filter(
job__inputs__archive_items__archive__phase=phase,
Expand Down
0