Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 7 additions & 7 deletions docs/generate_miners.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
warnings.filterwarnings("ignore")


def path(cls):
def path(cls: type[Any]) -> str:
module = importlib.import_module(cls.__module__)
return module.__name__ + "." + cls.__name__


def make(cls):
def make(cls: type[Any]) -> str:
p = path(cls)
return p.split(".")[2]


def model_type(cls):
def model_type(cls: type[Any]) -> str:
p = path(cls)
return p.split(".")[4]

Expand Down Expand Up @@ -67,7 +67,7 @@ def backend_str(backend: MinerTypes) -> str:
raise TypeError("Unknown miner backend, cannot generate docs")


def create_url_str(mtype: str):
def create_url_str(mtype: str) -> str:
return (
mtype.lower()
.replace(" ", "-")
Expand Down Expand Up @@ -143,7 +143,7 @@ def create_url_str(mtype: str):
done.append(miner)


def create_directory_structure(directory, data):
def create_directory_structure(directory: str | Path, data: dict[str, Any]) -> None:
if not os.path.exists(directory):
os.makedirs(directory)

Expand Down Expand Up @@ -171,11 +171,11 @@ def create_directory_structure(directory, data):
)


def create_supported_types(directory):
def create_supported_types(directory: str | Path) -> None:
with open(os.path.join(directory, "supported_types.md"), "w") as file:
file.write(SUPPORTED_TYPES_HEADER)
for mback in MINER_CLASSES:
backend_types = {}
backend_types: dict[str, list[type[Any]]] = {}
file.write(BACKEND_TYPE_HEADER.format(backend_str(mback)))
for mtype in MINER_CLASSES[mback]:
if mtype is None:
Expand Down
9 changes: 9 additions & 0 deletions pyasic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@
from pyasic.web import *

__version__ = importlib.metadata.version("pyasic")

__all__ = [
"settings",
"MinerConfig",
"MinerData",
"APIError",
"APIWarning",
"MinerNetwork",
]
Loading