Skip to content

Commit

Permalink
Merge pull request #1926 from opentensor/refactoring/opendansor/subne…
Browse files Browse the repository at this point in the history
…t-comments

Refactor: Fix miss-spelled words in comments and change '!=' to 'is not'
  • Loading branch information
opendansor committed May 23, 2024
2 parents 721c1c8 + b60210f commit c5dc22f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions bittensor/subnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ async def query_api(
axons: Union[bt.axon, List[bt.axon]],
deserialize: Optional[bool] = False,
timeout: Optional[int] = 12,
n: Optional[float] = 0.1,
uid: Optional[int] = None,
**kwargs: Optional[Any],
) -> Any:
"""
Expand All @@ -60,15 +58,13 @@ async def query_api(
axons (Union[bt.axon, List[bt.axon]]): The list of axon(s) to query.
deserialize (bool, optional): Whether to deserialize the responses. Defaults to False.
timeout (int, optional): The timeout in seconds for the query. Defaults to 12.
n (float, optional): The fraction of top nodes to consider based on stake. Defaults to 0.1.
uid (int, optional): The specific UID of the API node to query. Defaults to None.
**kwargs: Keyword arguments for the prepare_synapse_fn.
Returns:
Any: The result of the process_responses_fn.
"""
synapse = self.prepare_synapse(**kwargs)
bt.logging.debug(f"Quering valdidator axons with synapse {synapse.name}...")
bt.logging.debug(f"Querying validator axons with synapse {synapse.name}...")
responses = await self.dendrite(
axons=axons,
synapse=synapse,
Expand Down
4 changes: 2 additions & 2 deletions bittensor/synapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def cast_int(raw: str) -> int:
int or None: The converted integer, or ``None`` if the input was ``None``.
"""
return int(raw) if raw != None else raw # type: ignore
return int(raw) if raw is not None else raw # type: ignore


def cast_float(raw: str) -> float:
Expand All @@ -96,7 +96,7 @@ def cast_float(raw: str) -> float:
float or None: The converted float, or ``None`` if the input was ``None``.
"""
return float(raw) if raw != None else raw # type: ignore
return float(raw) if raw is not None else raw # type: ignore


class TerminalInfo(BaseModel):
Expand Down

0 comments on commit c5dc22f

Please sign in to comment.