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

pass block into the metagraph class #1798

Open
surcyf123 opened this issue Apr 17, 2024 · 0 comments
Open

pass block into the metagraph class #1798

surcyf123 opened this issue Apr 17, 2024 · 0 comments
Labels
feature new feature added

Comments

@surcyf123
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I am running a script to compare the weights at different times, and to do this I need to get the metagraph from a previous block. There is currently no way to pass in the block to bt.metagraph(), you first need to load the metagraph for a subnet and then run metagraph.sync( block=desired_block )

Describe the solution you'd like

Add a block parameter to the metagraph class to sync to a desired block without having to load the metagraph first for the current block.

Describe alternatives you've considered

No response

Additional context

block = subtensor.get_current_block()
print("Current block:", block)
meta = bt.metagraph(netuid=23, lite=False)
meta.sync(block=block)  # Sync the metagraph with the current block

# 1200 blocks earlier, or 4 hours
previous_block = block - 1200
meta2 = bt.metagraph(netuid=23, lite=False)
meta2.sync(block=previous_block)  # Sync the metagraph with the previous block

weights = meta.W.tolist()
weights2 = meta2.W.tolist()```
@surcyf123 surcyf123 added the feature new feature added label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature added
Projects
None yet
Development

No branches or pull requests

1 participant