Skip to content

refactor: inline single-use _reconnect_subtensor helper - #848

Closed
ebios-star wants to merge 1 commit into
entrius:testfrom
ebios-star:refactor/inline-reconnect-subtensor
Closed

refactor: inline single-use _reconnect_subtensor helper#848
ebios-star wants to merge 1 commit into
entrius:testfrom
ebios-star:refactor/inline-reconnect-subtensor

Conversation

@ebios-star

Copy link
Copy Markdown
Contributor

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

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

Testing

  • `grep -rn _reconnect_subtensor` confirms a single call site.
  • `uv run --extra dev pytest tests/` — all 652 tests pass.

Checklist

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

_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.
@ebios-star

Copy link
Copy Markdown
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. _reconnect_subtensor was a 3-line method called from exactly one place (the ConnectionClosedError retry branch in check_registered). grep confirms a single call site, no test references. -6/+2 lines, full test suite (652) passes.

Happy to rebase if needed.

@xiao-xiao-mao xiao-xiao-mao Bot added the refactor Code restructuring without behavior change label Apr 28, 2026
@anderdc anderdc closed this Apr 28, 2026
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