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 4 for refactoring bittensor/subtensor.py #1931

Merged
merged 1 commit 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 4: current part affects everything up to the subtensor().tx_rate_limit() method.
Test coverage improved.

Part 1 #1911
Part 2 #1913
Part 3 #1923

… it was decided to divide it into several stages.

This is part 4: current part affects everything up to the subtensor().tx_rate_limit() method.
Test coverage improved.

Part 1 #1911
Part 2 #1913
Part 3 #1923
@roman-opentensor roman-opentensor requested a review from a team May 23, 2024 23:02
@roman-opentensor roman-opentensor self-assigned this May 23, 2024
@roman-opentensor roman-opentensor changed the base branch from master to staging May 23, 2024 23:03
@roman-opentensor roman-opentensor marked this pull request as ready for review May 23, 2024 23:27
@opendansor
Copy link
Contributor

there are a few
Args: (Optional[int], optional):

But other than that, LGTM.

@roman-opentensor
Copy link
Contributor Author

roman-opentensor commented May 23, 2024

there are a few Args: (Optional[int], optional):

But other than that, LGTM.

This is correct docstring. First Optional[int] means the type of the argument. The second one optional means that you you may not provide this argument and in this case it have to be equal to default value.

For the comparison another example:

    def unstake_multiple(
        self,
        wallet: "bittensor.wallet",
        hotkey_ss58s: List[str],
        amounts: Optional[List[Union["Balance", float]]] = None,
        wait_for_inclusion: bool = True,
        wait_for_finalization: bool = False,
        prompt: bool = False,
    ) -> bool:
        """ 
        ...
        Args:
            amounts (Optional[List[Union[Balance, float]]], optional): The am ...
        ...
        """

It was confusing me too then I realized what does it mean.

@roman-opentensor roman-opentensor linked an issue May 24, 2024 that may be closed by this pull request
3 tasks
roman-opentensor added a commit that referenced this pull request May 24, 2024
… it was decided to divide it into several stages.

This is part 5: current part affects everything in this document except of renaming class `subtensor` according to the CamelCase rule.

Test coverage improved.

Part 1 #1911
Part 2 #1913
Part 3 #1923
Part 4 #1931
roman-opentensor added a commit that referenced this pull request 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
roman-opentensor added a commit that referenced this pull request 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
Copy link
Contributor

@ibraheem-opentensor ibraheem-opentensor left a comment

Choose a reason for hiding this comment

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

Overall LGTM
I personally prefer the left-hand style more due to its structure 😄 but that's just me
image

@roman-opentensor
Copy link
Contributor Author

Overall LGTM I personally prefer the left-hand style more due to its structure 😄 but that's just me image

the essence of my approach is that first we check edge cases and undesirable cases, and then happy)

@roman-opentensor roman-opentensor merged commit 90377f3 into staging May 24, 2024
11 checks passed
@roman-opentensor roman-opentensor deleted the refactoring/roman/subtensor-part-4 branch May 24, 2024 16:50
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
3 participants