21 lines
No EOL
533 B
Python
21 lines
No EOL
533 B
Python
|
|
import numpy as np
|
|
import json
|
|
|
|
class NumpyArrayEncoder(json.JSONEncoder):
|
|
def default(self, obj):
|
|
if isinstance(obj, np.integer):
|
|
return int(obj)
|
|
elif isinstance(obj, np.floating):
|
|
return float(obj)
|
|
elif isinstance(obj, np.ndarray):
|
|
return obj.tolist()
|
|
else:
|
|
return super(NumpyArrayEncoder, self).default(obj)
|
|
|
|
class BasSender:
|
|
def __init__(self) -> None:
|
|
pass
|
|
|
|
def send(self, messages):
|
|
raise NotImplementedError() |