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

take bt.config as a first argument regardless if specified #1664

Merged
merged 8 commits into from
Jan 24, 2024

Conversation

ifrit98
Copy link
Contributor

@ifrit98 ifrit98 commented Jan 22, 2024

Allows passing of bt.config object as first unnamed argument. The issue is that subtensor has named arguments for both network and config, but if passing a bt.config object as a first positional (and not explicitly naming), we get an error.

See subtensor __init__ definition:

    def __init__(
        self,
        network: str = None,
        config: "bittensor.config" = None,
        _mock: bool = False,
        log_verbose: bool = True,
    ) -> None:

Prior behavior:

import bittensor as bt
subtensor = bt.subtensor( bt.subtensor.config() )
> TypeError: unhashable type: 'slice'

This PR's Behavior:

import bittensor as bt
subtensor = bt.subtensor( bt.subtensor.config() )
> 2024-01-22 14:02:15.454 |       INFO       | You are connecting to finney network with endpoint wss://entrypoint-finney.opentensor.ai:443.

@ifrit98 ifrit98 merged commit 64a7cc9 into staging Jan 24, 2024
9 checks passed
@unconst unconst deleted the bugfix/subtensor-config-slice-error branch March 27, 2024 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants