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

Updating/improving/creating docstring codebase #2310

Merged
merged 50 commits into from
Sep 18, 2024

Conversation

roman-opentensor
Copy link
Contributor

@roman-opentensor roman-opentensor commented Sep 17, 2024

The changes contain changes/additions, as well as supplemented and updated examples of code usage.
The approaches to describing type annotations have been changed to bring the code base to consistency.
Other minor changes and refactoring.

DO NOT MERGE without @rajkaramchedu approval

@roman-opentensor roman-opentensor self-assigned this Sep 17, 2024
@roman-opentensor roman-opentensor added documentation Improvements or additions to documentation enhancement New feature or request bittensor labels Sep 17, 2024
@roman-opentensor roman-opentensor requested review from rajkaramchedu and a team September 17, 2024 03:06
bittensor/core/axon.py Show resolved Hide resolved
@@ -163,7 +172,7 @@ def stop(self):

class Axon:
"""
The ``axon`` class in Bittensor is a fundamental component that serves as the server-side interface for a neuron within the Bittensor network.
The ``Axon`` class in Bittensor is a fundamental component that serves as the server-side interface for a neuron within the Bittensor network.
Copy link
Contributor

Choose a reason for hiding this comment

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

Only needs a single backtick. Not sure where our style of double-backticks comes from

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I understand it, single backtick is used in cases of link and using the keyword :func: (For example: :func:uvicorn.Server). And double backticks allow to highlight a word.

bittensor/core/metagraph.py Outdated Show resolved Hide resolved
@@ -230,9 +230,9 @@ def __abs__(self):
@staticmethod
def from_float(amount: float):
"""
Given tao (float), return Balance object with rao(int) and tao(float), where rao = int(tao*pow(10,9))
Given tao, return :func:`Balance` object with rao(``int``) and tao(``float``), where rao = int(tao*pow(10,9))
Copy link
Contributor

Choose a reason for hiding this comment

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

is the use of the quotes inside a docstring really necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would delete. Raj wants to highlight the types of variables. Although they are described below.

Copy link
Contributor

Choose a reason for hiding this comment

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

I get that. I mean the "Balance" vs Balance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. :func:''Balance'' creates anchor link as # in HTML. I did it based on what I've seen Raj do. He will ultimately do it the way he wants users to see it :)

@thewhaleking thewhaleking self-requested a review September 17, 2024 15:49
@rajkaramchedu rajkaramchedu force-pushed the btsdk-docs/roman/docstrings-improvement branch from a58492a to 257b9a1 Compare September 18, 2024 02:46
Watchmaker and others added 4 commits September 17, 2024 21:23
# Conflicts:
#	bittensor/core/extrinsics/prometheus.py
#	bittensor/core/tensor.py
#	bittensor/utils/__init__.py
@roman-opentensor roman-opentensor merged commit 87a923d into btsdk Sep 18, 2024
12 checks passed
@roman-opentensor roman-opentensor deleted the btsdk-docs/roman/docstrings-improvement branch September 18, 2024 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bittensor documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants