I am currently generating a dataframe on a RPYC server and what to send this to the client when requested. When I send it across the server it is sent as a netref object. I want to be able to store this as a local variable on the client-side and not as a reference. It seems that RPYC has a built-in pickle protocol which I have tried to use with little success. The end goal is to be able to plot this dataframe on the client-side. The data acquisition for the dataframe is hardware-specific and for the sake of the current question have just loaded the sample data in as a csv.
Here is the server code
import rpyc
from rpyc.utils.server import ThreadedServer # or ForkingServer
import pandas as pd
class MyService(rpyc.Service):
def exposed_Dataframe_send(self):
resultsDF = pd.read_csv("Shared/PMBUS_Logging.csv")
print(type(resultsDF))
return resultsDF
if __name__ == "__main__":
server = ThreadedServer(MyService, port=18861, protocol_config={
'allow_public_attrs': True, "allow_pickle":True
})
server.start()
The client code
import rpyc
c = rpyc.connect("localhost", 18861, config={"allow_public_attrs": True, "allow_pickle":True})
x = c.root.Dataframe_send()
print(x)
print(type(x))
x.plot(figsize=[20,15])
Any help is appreciated