dissertation/where_fi/visualise/extract/__init__.py
Christos Falas 6f454c6190
add figure extractor
Used to store the protobuffer messages into files, so that they can be
plotted as part of the dissertation
2025-05-01 15:58:28 +01:00

21 lines
568 B
Python

import logging
import grpc
from ..generated import figure_pb2, figure_pb2_grpc
def run() -> None:
# NOTE(gRPC Python Team): .close() is possible on a channel and should be
# used in circumstances in which the with statement does not fit the needs
# of the code.
with grpc.insecure_channel("localhost:50051") as channel:
stub = figure_pb2_grpc.FigureServiceStub(channel)
for figure in stub.GetFigure(figure_pb2.FigureRequest()):
print(f"Figure: {figure}")
if __name__ == "__main__":
logging.basicConfig()
run()