plaid.utils.process_client¶
plaid.utils.process_client
¶
Class to use the /process capability of a server.
plaid.utils.process_client.PlaidClient
¶
Client for making requests to a PLAID process server.
Initialize a process server client.
Parameters:
-
host(str) –Hostname or IP address of the process server.
-
port(int) –Port number used by the process server.
Source code in plaid/utils/process_client.py
plaid.utils.process_client.PlaidClient.check_connection
¶
Check if the server is healthy by querying the health endpoint.
Source code in plaid/utils/process_client.py
plaid.utils.process_client.PlaidClient.process
¶
Send a single-sample request to the process endpoint.
The optional sample and any Sample passed as a keyword field are
JSON-encoded automatically. Other keyword fields are encoded with the
generic JSON codec, so NumPy arrays (and nested arrays in lists or
dicts) are sent as portable base64 payloads. The server operation
contract stays opaque to this client, which operates on a single sample
at a time.
Parameters:
-
sample(Sample | None, default:None) –Optional inline sample, sent as the
samplefield. -
**fields(Any, default:{}) –Additional request fields forwarded to the server. Any
Samplevalue is JSON-encoded, and any NumPy array is encoded with the portable base64 schema.
Returns:
-
Sample–The single
Samplereturned by the server.
Source code in plaid/utils/process_client.py
plaid.utils.process_client.PlaidClient.problem_definition
¶
Get the problem definition from the server.
Returns:
-
dict[str, Any]–A dictionary containing the problem definition as provided by the server.
Source code in plaid/utils/process_client.py
plaid.utils.process_client.PlaidClient.infos
¶
Get the infos from the server.
Returns:
-
dict[str, Any]–A dictionary containing the infos as provided by the server.
plaid.utils.process_client.PlaidClient.samples
¶
Request samples from the server by sample IDs and split.
Parameters:
-
sample_ids(list[int]) –A list of integers representing the IDs of the samples to request.
-
split(str) –A string indicating the data split (e.g., "training", "validation", "test") from which to request the samples.
Returns:
-
list[Sample]–A list of Sample objects corresponding to the requested sample IDs and split.