Describe the bug
Python Error while testing pyasic 0.58.0
(.venv) D:\git\pyasic2>python test_bitaxe_01.py
Traceback (most recent call last):
File "D:\git\pyasic2\test_bitaxe_01.py", line 2, in <module>
from pyasic import get_miner
File "D:\git\pyasic2\.venv\Lib\site-packages\pyasic\__init__.py", line 18, in <module>
from pyasic.data import MinerData
File "D:\git\pyasic2\.venv\Lib\site-packages\pyasic\data\__init__.py", line 32, in <module>
from pyasic.data.pools import PoolMetrics
File "D:\git\pyasic2\.venv\Lib\site-packages\pyasic\data\pools.py", line 35, in <module>
@dataclass
^^^^^^^^^
File "C:\Users\xx\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1232, in dataclass
return wrap(cls)
^^^^^^^^^
File "C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1222, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 1027, in _process_class
_init_fn(all_init_fields,
File "C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\dataclasses.py", line 545, in _init_fn
raise TypeError(f'non-default argument {f.name!r} '
TypeError: non-default argument 'url' follows default argument
To Reproduce
Test source from pyasic doc with pyasic 0.58.0
import asyncio
from pyasic import get_miner
async def gather_miner_data():
miner = await get_miner("192.168.0.202")
if miner is not None:
miner_data = await miner.get_data()
print(miner_data) # all data from the dataclass
print(miner_data.hashrate) # hashrate of the miner in TH/s
if __name__ == "__main__":
asyncio.run(gather_miner_data())
Describe the bug Python Error while testing pyasic 0.58.0
To Reproduce Test source from pyasic doc with pyasic 0.58.0
Looks like this was broken?: https://github.com/UpstreamData/pyasic/blob/f405bbff4d37a4a6cf96e515f4bfb0f3fce63034/pyasic/data/pools.py#L35-L55
No error with pyasic 0.57.6