Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update serialization.md to include deprecation of serializable values #4411

Merged
merged 3 commits into from Aug 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/dev/serialization.md
Expand Up @@ -113,6 +113,18 @@ Ideally, the contents of the `.repr` file are exactly the output of
`your_class_name.json` should contain the expected JSON output when serializing
the test value from `your_class_name.repr`.

## Deprecating a serializable value
When a serializable value is marked deprecated, but is not yet removed, the
`.json` and `.repr` files continue to exist but `json_serialization_test.py`
will start complaining that deprecated values cannot be used in tests.
In order to fix this, one should add an entry corresponding to deprecated value to the `deprecated` dict in
`cirq-<module>/cirq/protocols/json_test_data/spec.py`, of the form:
```python
deprecated={
'deprecated_value': 'deprecation_version',
tanujkhattar marked this conversation as resolved.
Show resolved Hide resolved
}
```

## Removing a serializable value

When a serializable value is removed from cirq, old serialized instances
Expand Down