refactor: optimize imports.

This commit is contained in:
UpstreamData
2024-01-11 15:00:48 -07:00
parent c80ca1415a
commit 4156f93c0d
35 changed files with 9 additions and 76 deletions

View File

@@ -14,8 +14,7 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from collections import namedtuple from typing import List, Optional
from typing import List, Optional, Tuple
from pyasic.API.bfgminer import BFGMinerAPI from pyasic.API.bfgminer import BFGMinerAPI
from pyasic.config import MinerConfig from pyasic.config import MinerConfig

View File

@@ -15,8 +15,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import logging import logging
from collections import namedtuple from typing import List, Optional
from typing import List, Optional, Tuple
from pyasic.API.bmminer import BMMinerAPI from pyasic.API.bmminer import BMMinerAPI
from pyasic.config import MinerConfig from pyasic.config import MinerConfig

View File

@@ -15,8 +15,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import logging import logging
from collections import namedtuple from typing import List, Optional
from typing import List, Optional, Tuple
from pyasic.API.btminer import BTMinerAPI from pyasic.API.btminer import BTMinerAPI
from pyasic.config import MinerConfig, MiningModeConfig from pyasic.config import MinerConfig, MiningModeConfig
@@ -29,7 +28,6 @@ from pyasic.miners.base import (
DataLocations, DataLocations,
DataOptions, DataOptions,
RPCAPICommand, RPCAPICommand,
WebAPICommand,
) )
BTMINER_DATA_LOC = DataLocations( BTMINER_DATA_LOC = DataLocations(

View File

@@ -15,8 +15,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import logging import logging
from collections import namedtuple from typing import List, Optional
from typing import List, Optional, Tuple
from pyasic.API.cgminer import CGMinerAPI from pyasic.API.cgminer import CGMinerAPI
from pyasic.config import MinerConfig from pyasic.config import MinerConfig

View File

@@ -14,7 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import logging
import re import re
from typing import List, Optional from typing import List, Optional

View File

@@ -14,10 +14,9 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from typing import List, Optional, Tuple from typing import List, Optional
from pyasic import MinerConfig from pyasic.config import MinerConfig
from pyasic.config import MinerConfig, MiningModeConfig
from pyasic.data import Fan, HashBoard from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import MinerErrorData, X19Error from pyasic.data.error_codes import MinerErrorData, X19Error
from pyasic.errors import APIError from pyasic.errors import APIError

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
from typing import Optional
from pyasic.miners.backends import BMMiner from pyasic.miners.backends import BMMiner

View File

@@ -13,18 +13,12 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import asyncio
import logging
from collections import namedtuple
from typing import List, Optional, Tuple, Union from typing import List, Optional, Tuple, Union
import toml
from pyasic.API.bosminer import BOSMinerAPI
from pyasic.API.luxminer import LUXMinerAPI from pyasic.API.luxminer import LUXMinerAPI
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import Fan, HashBoard from pyasic.data import Fan, HashBoard
from pyasic.data.error_codes import BraiinsOSError, MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.errors import APIError from pyasic.errors import APIError
from pyasic.miners.base import ( from pyasic.miners.base import (
BaseMiner, BaseMiner,
@@ -32,9 +26,7 @@ from pyasic.miners.base import (
DataLocations, DataLocations,
DataOptions, DataOptions,
RPCAPICommand, RPCAPICommand,
WebAPICommand,
) )
from pyasic.web.bosminer import BOSMinerWebAPI
LUXMINER_DATA_LOC = DataLocations( LUXMINER_DATA_LOC = DataLocations(
**{ **{

View File

@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import logging
from typing import List, Optional from typing import List, Optional
from pyasic.config import MinerConfig from pyasic.config import MinerConfig

View File

@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import AvalonMiner from pyasic.miners.makes import AvalonMiner

View File

@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import AvalonMiner from pyasic.miners.makes import AvalonMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -14,8 +14,6 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import warnings
from pyasic.miners.makes import WhatsMiner from pyasic.miners.makes import WhatsMiner

View File

@@ -20,7 +20,6 @@ from pyasic.API.unknown import UnknownAPI
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import Fan, HashBoard, MinerData from pyasic.data import Fan, HashBoard, MinerData
from pyasic.data.error_codes import MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.errors import APIError
from pyasic.miners.base import BaseMiner from pyasic.miners.base import BaseMiner

View File

@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import ipaddress
import warnings import warnings
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import Union from typing import Union

View File

@@ -14,13 +14,12 @@
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import json import json
import warnings
from typing import Union from typing import Union
import httpx import httpx
from pyasic import settings from pyasic import settings
from pyasic.errors import APIError, APIWarning from pyasic.errors import APIError
from pyasic.web import BaseWebAPI from pyasic.web import BaseWebAPI

View File

@@ -13,16 +13,12 @@
# See the License for the specific language governing permissions and - # See the License for the specific language governing permissions and -
# limitations under the License. - # limitations under the License. -
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import asyncio
import inspect
import sys
import unittest import unittest
import warnings import warnings
from dataclasses import asdict from dataclasses import asdict
from pyasic.miners.backends import CGMiner # noqa from pyasic.miners.backends import CGMiner # noqa
from pyasic.miners.base import BaseMiner from pyasic.miners.miner_factory import MINER_CLASSES
from pyasic.miners.miner_factory import MINER_CLASSES, MinerFactory
class MinersTest(unittest.TestCase): class MinersTest(unittest.TestCase):