WorkflowSchema

class propertyestimator.workflow.schemas.WorkflowSchema(property_type=None)[source]

Outlines the workflow which should be followed when calculating a certain property.

__init__(property_type=None)[source]

Constructs a new WorkflowSchema object.

Parameters

property_type (str) – The type of property which this workflow aims to estimate.

Methods

__init__([property_type])

Constructs a new WorkflowSchema object.

json()

Creates a JSON representation of this class.

parse_json(string_contents[, encoding])

Parses a typed json string into the corresponding class structure.

replace_protocol_types(protocol_replacements)

Replaces protocols with given types with other protocols of specified replacements.

validate_interfaces()

Validates the flow of the data between protocols, ensuring that inputs and outputs correctly match up.

replace_protocol_types(protocol_replacements, protocol_group_schema=None)[source]

Replaces protocols with given types with other protocols of specified replacements. This is useful when replacing the default protocols with custom ones, or swapping out base protocols with actual implementations

Warning

This method is NOT fully implemented and is likely to fail in all but a few specific cases. This method should be used with extreme caution.

Parameters
  • protocol_replacements (dict of str and str, None) – A dictionary with keys of the types of protocols which should be replaced with those protocols named by the values.

  • protocol_group_schema (ProtocolGroupSchema) – The protocol group to apply the replacements to. This is mainly used when applying this method recursively.

validate_interfaces()[source]

Validates the flow of the data between protocols, ensuring that inputs and outputs correctly match up.

json()

Creates a JSON representation of this class.

Returns

The JSON representation of this class.

Return type

str

classmethod parse_json(string_contents, encoding='utf8')

Parses a typed json string into the corresponding class structure.

Parameters
  • string_contents (str or bytes) – The typed json string.

  • encoding (str) – The encoding of the string_contents.

Returns

The parsed class.

Return type

Any