Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part 6 for refactoring bittensor/subtensor.py - class CamelCase #1935

Merged
merged 6 commits into from
May 24, 2024

Conversation

roman-opentensor
Copy link
Contributor

Since the refactoring of this module would turn into a large project, it was decided to divide it into several stages.

This is part 6: Renaming class 1 to comply with PEP8 and avoid namespace conflict. Refactor all references to the changed name.

Part 1 #1911
Part 2 #1913
Part 3 #1923
Part 4 #1931
Part 5 #1934

… it was decided to divide it into several stages.

This is part 6: Renaming class 1 to comply with PEP8 and avoid namespace conflict. Refactor all references to the changed name.

Part 1 #1911
Part 2 #1913
Part 3 #1923
Part 4 #1931
Part 5 #1934
@roman-opentensor roman-opentensor requested a review from a team May 24, 2024 04:58
@roman-opentensor roman-opentensor self-assigned this May 24, 2024
@roman-opentensor roman-opentensor changed the title Part 4 for refactoring bittensor/subtensor.py - class CamelCase Part 6 for refactoring bittensor/subtensor.py - class CamelCase May 24, 2024
… it was decided to divide it into several stages.

This is part 6: Renaming class 1 to comply with PEP8 and avoid namespace conflict. Refactor all references to the changed name.

Part 1 #1911
Part 2 #1913
Part 3 #1923
Part 4 #1931
Part 5 #1934
bittensor/__init__.py Outdated Show resolved Hide resolved
bittensor/subtensor.py Outdated Show resolved Hide resolved
# Double import allows using class `Subtensor` by referencing `bittensor.Subtensor` and `bittensor.subtensor`.
# This will be available for a while until we remove reference `bittensor.subtensor`
from .subtensor import Subtensor
from .subtensor import Subtensor as subtensor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't remove the bt.subtensor factory design.

Copy link
Contributor Author

@roman-opentensor roman-opentensor May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still under discussion. Both options are available now, as we discussed in the chat.

@mjurbanski-reef
Copy link
Contributor

as a Python Developer and bittensor user, I must say that it may seem small, but moving towards getting rid of confusing classes masking over the modules may seem silly, but is an awesome, quality of life change. Both I and my IDE are getting confused with bt.subtensor :)

@roman-opentensor
Copy link
Contributor Author

as a Python Developer and bittensor user, I must say that it may seem small, but moving towards getting rid of confusing classes masking over the modules may seem silly, but is an awesome, quality of life change. Both I and my IDE are getting confused with bt.subtensor :)

Thank you for such warm feedback!

We really try to do everything so that the community gets the best experience both as developers and as users who are not related to programming. The more and more detailed community's requests, feedback, and suggestions we receive, the better the Bittensor becomes!

Copy link
Contributor

@thewhaleking thewhaleking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, but revert the license wording change. I do like adding some kind of deprecation warning for the subtensor that we discussed, but it's not immediately necessary.

bittensor/utils/wallet_utils.py Outdated Show resolved Hide resolved
@roman-opentensor roman-opentensor marked this pull request as ready for review May 24, 2024 20:38
@roman-opentensor roman-opentensor merged commit 621d0c7 into staging May 24, 2024
11 checks passed
@roman-opentensor roman-opentensor deleted the refactoring/roman/subtensor-part-6 branch May 24, 2024 21:02
@roman-opentensor roman-opentensor linked an issue May 24, 2024 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bittensor.subtensor module refactoring
5 participants