Skip to content

refactor: remove dead parse_github_timestamp_to_cst and its pytz dependency#1291

Open
ebios-star wants to merge 2 commits into
entrius:testfrom
ebios-star:refactor/remove-dead-cst-timestamp-helper
Open

refactor: remove dead parse_github_timestamp_to_cst and its pytz dependency#1291
ebios-star wants to merge 2 commits into
entrius:testfrom
ebios-star:refactor/remove-dead-cst-timestamp-helper

Conversation

@ebios-star
Copy link
Copy Markdown
Contributor

Summary

parse_github_timestamp_to_cst parsed GitHub ISO timestamps and converted them to the America/Chicago timezone. It has no remaining call sites — scoring works entirely in UTC via parse_github_iso_to_utc / parse_optional_github_iso_to_utc.

It was the sole consumer of the module-level CHICAGO_TZ constant, which in turn was the sole consumer of import pytz. So the whole chain is dead and goes together:

  • parse_github_timestamp_to_cst function
  • CHICAGO_TZ = pytz.timezone('America/Chicago')
  • import pytz

grep -rn pytz --include='*.py' across gittensor/ and neurons/ confirms pytz appears nowhere else, so this also drops pytz as a runtime import. (I've left the dependency manifest untouched — whether to also drop pytz from project dependencies is a separate call for a maintainer, since transitive deps may still pull it.)

grep -rn parse_github_timestamp_to_cst across gittensor/, neurons/, and tests/ returns only the (now removed) definition.

Net: -12 lines, single file. Same dead-code-chain shape as #466 and #1187.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • pytest tests/ — all 739 tests pass.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

…ndency

parse_github_timestamp_to_cst converted GitHub ISO timestamps to the
America/Chicago timezone. It has no remaining call sites — scoring works
entirely in UTC via parse_github_iso_to_utc / parse_optional_github_iso_to_utc.

It was the sole consumer of the module-level CHICAGO_TZ constant, which
in turn was the sole consumer of 'import pytz'. Removing the function
lets the whole chain go: grep -rn confirms 'pytz' now appears nowhere
else in gittensor/ or neurons/, so this also drops pytz as a runtime
import.

Verified via 'grep -rn parse_github_timestamp_to_cst' and 'grep -rn pytz'
across gittensor/, neurons/, and tests/.
@ebios-star
Copy link
Copy Markdown
Contributor Author

@anderdc whenever you have a moment, this drops a dead CST-timestamp helper and the pytz import chain it solely kept alive. Happy to revise scope if you'd prefer. Thanks!

@xiao-xiao-mao xiao-xiao-mao Bot added the refactor Code restructuring without behavior change label May 15, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 19, 2026

Fix conflicts.

…cst-timestamp-helper

# Conflicts:
#	gittensor/validator/utils/datetime_utils.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants