Skip to content

Commit 5ab8b06

Browse files
committed
lint fixes
1 parent 14c2287 commit 5ab8b06

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

metrics/interfaces/management/commands/seed_random.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from collections.abc import Iterable
44
from datetime import date, timedelta
55
from decimal import Decimal
6+
from typing import override
67

78
from django.core.management import CommandParser, call_command
89
from django.core.management.base import BaseCommand
@@ -30,6 +31,7 @@
3031

3132

3233
class Command(BaseCommand):
34+
@override
3335
def add_arguments(self, parser: CommandParser) -> None:
3436
parser.add_argument(
3537
"--dataset",
@@ -63,8 +65,8 @@ def handle(self, *args, **options) -> None:
6365
random.seed(selected_seed)
6466
self.stdout.write(f"Seed used: {selected_seed}")
6567

66-
should_seed_cms = dataset in ("cms", "both")
67-
should_seed_metrics = dataset in ("metrics", "both")
68+
should_seed_cms = dataset in {"cms", "both"}
69+
should_seed_metrics = dataset in {"metrics", "both"}
6870

6971
counts: dict[str, int] = {
7072
"Theme": 0,
@@ -205,8 +207,8 @@ def _seed_time_series_rows(
205207
for geography in geographies:
206208
for day_offset in range(days):
207209
current_date = start_date + timedelta(days=day_offset)
208-
base_value = random.uniform(5.0, 250.0)
209-
metric_value = round(base_value + random.uniform(-10.0, 10.0), 2)
210+
base_value = random.uniform(5.0, 250.0) # noqa: S311
211+
metric_value = round(base_value + random.uniform(-10.0, 10.0), 2) # noqa: S311
210212
epidemiological_week = current_date.isocalendar().week
211213

212214
core_rows.append(

0 commit comments

Comments
 (0)