Returns a factory for constructing objects of type type_str
.
cirq.protocols.json_serialization.factory_from_json(
type_str: str, resolvers: Optional[Sequence[JsonResolver]] = None
) -> cirq.json_resolver_cache.ObjectFactory
DEFAULT_RESOLVERS is updated dynamically as cirq submodules are imported.
Args |
type_str
|
string representation of the type to deserialize.
|
resolvers
|
list of JsonResolvers to use in type resolution. If this is
left blank, DEFAULT_RESOLVERS will be used.
|
Returns |
An ObjectFactory that can be called to construct an object whose type
matches the name type_str .
|
Raises |
ValueError
|
if type_str does not have a match in resolvers .
|