Skip to content

Updating/improving/creating docstring codebase#2310

Merged
basfroman merged 50 commits intobtsdkfrom
btsdk-docs/roman/docstrings-improvement
Sep 18, 2024
Merged

Updating/improving/creating docstring codebase#2310
basfroman merged 50 commits intobtsdkfrom
btsdk-docs/roman/docstrings-improvement

Conversation

@basfroman
Copy link
Collaborator

@basfroman basfroman 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

@basfroman basfroman self-assigned this Sep 17, 2024
@basfroman basfroman added documentation Improvements or additions to documentation enhancement New feature or request bittensor labels Sep 17, 2024
@basfroman basfroman requested review from a team and rajkaramchedu September 17, 2024 03:06
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
Collaborator 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.

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
Collaborator 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
Collaborator 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
@basfroman basfroman merged commit 87a923d into btsdk Sep 18, 2024
@basfroman basfroman deleted the btsdk-docs/roman/docstrings-improvement branch September 18, 2024 05:06
@ibraheem-abe ibraheem-abe mentioned this pull request Sep 25, 2024
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