refactor: optimize imports.

This commit is contained in:
UpstreamData
2024-01-11 15:00:48 -07:00
parent 6f64cc5e0d
commit 2ef85d3868
35 changed files with 10 additions and 77 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,18 +13,12 @@
# See the License for the specific language governing permissions and -
# limitations under the License. -
# ------------------------------------------------------------------------------
import asyncio
import logging
from collections import namedtuple
from typing import List, Optional, Tuple, Union
import toml
from pyasic.API.bosminer import BOSMinerAPI
from pyasic.API.luxminer import LUXMinerAPI
from pyasic.config import MinerConfig
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.miners.base import (
BaseMiner,
@@ -32,9 +26,7 @@ from pyasic.miners.base import (
DataLocations,
DataOptions,
RPCAPICommand,
WebAPICommand,
)
from pyasic.web.braiins_os import BOSMinerWebAPI
LUXMINER_DATA_LOC = DataLocations(
**{
@@ -341,7 +333,7 @@ class LUXMiner(BaseMiner):
return round(expected_rate / 1000000, 2)
else:
return round(expected_rate, 2)
except LookupError:
except (KeyError, IndexError):
pass
async def _is_mining(self) -> Optional[bool]:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -14,8 +14,6 @@
# limitations under the License. -
# ------------------------------------------------------------------------------
import warnings
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.data import Fan, HashBoard, MinerData
from pyasic.data.error_codes import MinerErrorData
from pyasic.errors import APIError
from pyasic.miners.base import BaseMiner

View File

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

View File

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

View File

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