quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.3k stars 1.02k forks source link

Use decorators instead of lists for JSON testing #3734

Open balopat opened 3 years ago

balopat commented 3 years ago

Is your feature request related to a use case or problem? Please describe.

Currently when one introduces a new public class in the cirq namespace, they have to add either make it json serializable and provide test data or have to mark them as "not yet serializable" or "should not be serializable". With the modularization of the JSON testing these lists are going to get unwieldy, as for each module we'll have two lists that the objects should belong.

Describe the solution you'd like

Instead of maintaining lists of object names, instead we could use python decorators @cirq.exempt_from_json_serialization(reason='not_yet'), @cirq.exempt_from_json_serialization(reason='never').

What is the urgency from your perspective for this issue? Is it blocking important work?

P1 - I need this no later than the next release (end of quarter)

verult commented 2 years ago

Not sure if this has been done yet - cc @dstrain115 @mpharrigan

mpharrigan commented 2 years ago

this is low priority, moving to post-1.0