Skip to content
Open
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
12 changes: 0 additions & 12 deletions gittensor/validator/utils/datetime_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
from datetime import datetime, timezone
from typing import Optional

import pytz

from gittensor.constants import SECONDS_PER_HOUR
from gittensor.validator.utils.load_weights import ResolvedTimeDecay

CHICAGO_TZ = pytz.timezone('America/Chicago')


def parse_github_iso_to_utc(timestamp_str: str) -> datetime:
"""Parse a GitHub-style ISO 8601 string to a timezone-aware UTC datetime.
Expand All @@ -34,14 +30,6 @@ def parse_optional_github_iso_to_utc(value: Optional[str]) -> Optional[datetime]
return parse_github_iso_to_utc(value) if value else None


def parse_github_timestamp_to_cst(timestamp_str: str) -> datetime:
"""
Parse GitHub's ISO format timestamp and convert to Chicago timezone.
GitHub returns timestamps like: 2024-01-15T10:30:00Z
"""
return parse_github_iso_to_utc(timestamp_str).astimezone(CHICAGO_TZ)


def calculate_time_decay(merged_at: datetime, time_decay: ResolvedTimeDecay) -> float:
"""Calculate sigmoid-based time decay multiplier from a merge timestamp."""
now = datetime.now(timezone.utc)
Expand Down
Loading