aihwkit.cloud.client.v1.parsers module¶
Parsers for the AIHW Composer API.
-
class
aihwkit.cloud.client.v1.parsers.
ExperimentParser
[source]¶ Bases:
object
Parser for Experiment API responses.
-
static
parse_date_string
(date_string)[source]¶ Return a datetime from a date string.
- Parameters
date_string (str) – the date string from the API.
- Returns
A value from the CloudExperimentCategory enum.
- Return type
datetime.datetime
-
static
parse_experiment
(api_response, api_client)[source]¶ Return a CloudExperiment from an API response.
- Parameters
api_response (Dict) – the response from the API.
api_client (Any) – the client to be used in API requests.
- Returns
A CloudExperiment based on the response. Some of the fields might not be populated if they are not present in the response.
- Return type
-
static
parse_experiment_category
(api_response)[source]¶ Return an Experiment category from an API response.
- Parameters
api_response (Dict) – the response from the API.
- Returns
A value from the CloudExperimentCategory enum.
- Raises
InvalidResponseFieldError – if the API response contains an unrecognized category.
- Return type
-
static
parse_experiment_status
(api_response)[source]¶ Return an Experiment status from an API response.
- Parameters
api_response (Dict) – the response from the API.
- Returns
A value from the CloudJobStatus enum.
- Raises
InvalidResponseFieldError – if the API response contains an unrecognized status code.
- Return type
-
static