Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

Remove `id` from top-level notebook structure.

Open markmcd opened this issue 3 years ago • 2 comments
trafficstars

nbformat currently barfs on this notebook as it has an id field set directly on the cell. They're expected under a metadata field, and this notebook already has them set on the metadata, so assuming they're otherwise unused I have removed them.

Here's the error, in case it helps:

E 2022-09-08 20:30:15.962852-070026 57758 __init__.py:80 Notebook JSON is invalid: Additional properties are not allowed ('id' was unexpected)

Failed validating 'additionalProperties' in code_cell:

On instance['cells'][0]:
{'cell_type': 'code',
 'execution_count': 1,
 'id': 'ee22a795',
 'metadata': {'cellView': 'form',
              'execution': {'iopub.execute_input': '2022-07-07T09:27:05.420016Z',
                            'iopub.status.busy': '2022-07-07T09:27:05.419434Z',
                            'iopub.status.idle': '2022-07-07T09:27:05.423857Z',
                            'shell.execute_reply': '2022-07-07T09:27:05.423255Z'},
              'id': '906e07f6e562'},
 'outputs': ['...0 outputs...'],
 'source': '# @title Copyright 2022 The Cirq Developers\n'
           '# Licensed under the...'}

markmcd avatar Sep 14 '22 05:09 markmcd

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Failed Pytest looks like differences in floating point rounding, I'm guessing unrelated to this change?

markmcd avatar Sep 14 '22 06:09 markmcd

@markmcd What did you run to get this error? This passes on the master branch for me.

(cirq_venv) vtomole@vtomole:~/Cirq$ ./check/nbformat 
Notebooks are formatted.

vtomole avatar Oct 14 '22 20:10 vtomole