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

Add developer doc explaining serialization #2548

Merged
merged 8 commits into from Nov 15, 2019
Merged

Add developer doc explaining serialization #2548

merged 8 commits into from Nov 15, 2019

Conversation

Strilanc
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Nov 14, 2019

When writing JSON, Cirq checks if the given object has a `_json_dict_` method.
If it does, the object is replaced by the output of that method.
Otherwise there are a series of several hardcoded cases for complex numbers, numpy arrays, sympy expressions, and a few others.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think it should be "Otherwise, there are..." with a comma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

how to remove a serializable object from cirq while maintaing backwards compatibility with old serialized files,
and various related guidelines.

## Exposed API
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: should there be a short background doc to explain why we want/need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool. I imagine this will be very helpful

Nit: I'm confused by the line wrapping in this file. It seems to be by sentence, except when it isn't

@Strilanc
Copy link
Contributor Author

I'm confused by the line wrapping in this file. It seems to be by sentence, except when it isn't

It line wraps at the end of sentences and also when the length gets too long. I wrote it in github's editor so I didn't have the 80 column guide.

@Strilanc Strilanc added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Nov 14, 2019
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Nov 14, 2019
@CirqBot
Copy link
Collaborator

CirqBot commented Nov 14, 2019

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Nov 14, 2019
@Strilanc Strilanc added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Nov 15, 2019
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Nov 15, 2019
@CirqBot CirqBot merged commit a4025d1 into master Nov 15, 2019
@CirqBot CirqBot removed the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Nov 15, 2019
@CirqBot CirqBot deleted the Strilanc-patch-1 branch November 15, 2019 01:17
@CirqBot CirqBot removed the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants