refactor: remove dead parse_github_timestamp_to_cst and its pytz dependency#1291
Open
ebios-star wants to merge 2 commits into
Open
refactor: remove dead parse_github_timestamp_to_cst and its pytz dependency#1291ebios-star wants to merge 2 commits into
ebios-star wants to merge 2 commits into
Conversation
…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/.
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! |
Collaborator
|
Fix conflicts. |
…cst-timestamp-helper # Conflicts: # gittensor/validator/utils/datetime_utils.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parse_github_timestamp_to_cstparsed GitHub ISO timestamps and converted them to theAmerica/Chicagotimezone. It has no remaining call sites — scoring works entirely in UTC viaparse_github_iso_to_utc/parse_optional_github_iso_to_utc.It was the sole consumer of the module-level
CHICAGO_TZconstant, which in turn was the sole consumer ofimport pytz. So the whole chain is dead and goes together:parse_github_timestamp_to_cstfunctionCHICAGO_TZ = pytz.timezone('America/Chicago')import pytzgrep -rn pytz --include='*.py'acrossgittensor/andneurons/confirmspytzappears nowhere else, so this also dropspytzas a runtime import. (I've left the dependency manifest untouched — whether to also droppytzfrom project dependencies is a separate call for a maintainer, since transitive deps may still pull it.)grep -rn parse_github_timestamp_to_cstacrossgittensor/,neurons/, andtests/returns only the (now removed) definition.Net: -12 lines, single file. Same dead-code-chain shape as #466 and #1187.
Type of Change
Testing
pytest tests/— all 739 tests pass.Checklist