cirq.read_json_gzip
Read a gzipped JSON file that optionally contains cirq objects.
cirq.read_json_gzip(
file_or_fn: Union[None, IO, pathlib.Path, str] = None,
*,
gzip_raw: Optional[bytes] = None,
resolvers: Optional[Sequence[JsonResolver]] = None
)
Args |
file_or_fn
|
A filename (if a string or pathlib.Path ) to read from, or
an IO object (such as a file or buffer) to read from, or None to
indicate that gzip_raw argument should be used. Defaults to
None .
|
gzip_raw
|
Bytes representing the raw gzip input to unzip and parse
or else None indicating file_or_fn should be used. Defaults to
None .
|
resolvers
|
A list of functions that are called in order to turn
the serialized cirq_type string into a constructable class.
By default, top-level cirq objects that implement the SupportsJSON
protocol are supported. You can extend the list of supported types
by pre-pending custom resolvers. Each resolver should return None
to indicate that it cannot resolve the given cirq_type and that
the next resolver should be tried.
|
Raises |
ValueError
|
If either none of file_or_fn and gzip_raw is specified,
or both are specified.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]