Request
- class openff.evaluator.client.Request(client=None)[source]
An estimation request which has been sent to a EvaluatorServer instance.
This object can be used to query and retrieve the results of the request when finished, or be stored to retrieve the request at some point in the future.
- __init__(client=None)[source]
- Parameters
client (EvaluatorClient, optional) – The client which submitted this request.
Methods
__init__
([client])- param client
The client which submitted this request.
from_json
(file_path)Create this object from a JSON file.
get_attributes
([attribute_type])Returns all attributes of a specific attribute_type.
json
([file_path, format])Creates a JSON representation of this class.
parse_json
(string_contents)Parses a typed json string into the corresponding class structure.
results
([synchronous, polling_interval])Attempt to retrieve the results of the request from the server.
validate
([attribute_type])Validate the values of the attributes.
Attributes
The options used to connect to the server handling the request.
The unique id assigned to this request by the server.
- id
The unique id assigned to this request by the server. The default value of this attribute is not set and must be set by the user..
- Type
- connection_options
The options used to connect to the server handling the request. The default value of this attribute is not set and must be set by the user..
- Type
- results(synchronous=False, polling_interval=5)[source]
Attempt to retrieve the results of the request from the server.
If the method is run synchronously it will block the main thread either all of the requested properties have been estimated, or an exception is returned.
- Parameters
synchronous (bool) – If True, this method will block the main thread until the server either returns a result or an error.
polling_interval (float) – If running synchronously, this is the time interval (seconds) between checking if the calculation has finished. This will be ignored if running asynchronously.
- Returns
RequestResult, optional – Returns the current results of the request. This may be None if any unexpected exceptions occurred while retrieving the estimate.
EvaluatorException, optional – The exception raised will trying to retrieve the result if any.
- classmethod from_json(file_path)
Create this object from a JSON file.
- Parameters
file_path (str) – The path to load the JSON from.
- Returns
The parsed class.
- Return type
cls
- classmethod get_attributes(attribute_type=None)
Returns all attributes of a specific attribute_type.
- Parameters
attribute_type (type of Attribute, optional) – The type of attribute to search for.
- Returns
The names of the attributes of the specified type.
- Return type
list of str
- classmethod parse_json(string_contents)
Parses a typed json string into the corresponding class structure.
- validate(attribute_type=None)
Validate the values of the attributes. If attribute_type is set, only attributes of that type will be validated.
- Parameters
attribute_type (type of Attribute, optional) – The type of attribute to validate.
- Raises
ValueError or AssertionError –