declearn.communication.messaging.parse_message_from_string
DEPRECATED - Instantiate a Message from its serialized string.
This function was DEPRECATED in DecLearn 2.4 and will be removed
in v2.6 and/or v3.0. Use the declearn.messaging.SerializedMessage
API to parse serialized message strings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
string |
str
|
Serialized string dump of the message. |
required |
Returns:
Name | Type | Description |
---|---|---|
message |
Message
|
Message instance recovered from the input string. |
Raises:
Type | Description |
---|---|
KeyError
|
If the string's typekey does not match any supported Message subclass. |
TypeError
|
If the string cannot be parsed to identify a message typekey. |
ValueError
|
If the serialized data fails to be properly decoded. |
Source code in declearn/communication/messaging/_messages.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|