refactor: inline single-use _reconnect_subtensor helper - #848
Closed
ebios-star wants to merge 1 commit into
Closed
Conversation
_reconnect_subtensor was a 3-line method on BaseNeuron called from exactly one place — the ConnectionClosedError retry branch in check_registered. Inlining matches the merged entrius#748 / entrius#801 pattern (single-use private helper folded into its only caller); the inlined two lines (info log + Subtensor instantiation) read just as cleanly in the retry context. `grep -rn _reconnect_subtensor` confirms no other call sites in gittensor/, neurons/, or tests/. -6/+2 lines, full test suite passes.
Contributor
Author
|
@anderdc @LandynDev — friendly ping for review when you have a moment. Same family as #748 / #801 / #802 (all merged) — single-use private method inlined into its only caller. Happy to rebase if needed. |
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
`_reconnect_subtensor` in neurons/base/neuron.py was a 3-line method on `BaseNeuron` called from exactly one place — the `ConnectionClosedError` retry branch in `check_registered`. Inlining matches the merged #748 / #801 / #802 pattern (single-use private helper folded into its only caller); the inlined two lines (info log + Subtensor instantiation) read just as cleanly in the retry context.
`grep -rn _reconnect_subtensor` confirms no other call sites in `gittensor/`, `neurons/`, or `tests/`.
Net: -6 / +2 lines, one fewer private method on `BaseNeuron`. No behavior change.
Related Issues
N/A — same family of cleanups as #641 / #748 / #801 / #802.
Type of Change
Testing
Checklist