Skip to content

Support the deprecated_parameter decorator for asynchronous functions.#6247

Merged
pavoljuhas merged 2 commits intoquantumlib:masterfrom
jurruti:u/urruti/async_deprecate_parameter
Aug 16, 2023
Merged

Support the deprecated_parameter decorator for asynchronous functions.#6247
pavoljuhas merged 2 commits intoquantumlib:masterfrom
jurruti:u/urruti/async_deprecate_parameter

Conversation

@jurruti
Copy link
Copy Markdown
Contributor

@jurruti jurruti commented Aug 16, 2023

No description provided.

@jurruti jurruti requested review from a team, cduck and vtomole as code owners August 16, 2023 00:51
@jurruti jurruti requested a review from pavoljuhas August 16, 2023 00:51
@CirqBot CirqBot added the size: M 50< lines changed <250 label Aug 16, 2023
@jurruti
Copy link
Copy Markdown
Contributor Author

jurruti commented Aug 16, 2023

This feature is necessary because I need to deprecate the parameter processor_ids within the EngineClient, EngineProgram and Engine (within cirq-google). The methods it appears in are asynchronous.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 16, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (9fbaa05) 97.38% compared to head (0de8f03) 97.38%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6247   +/-   ##
=======================================
  Coverage   97.38%   97.38%           
=======================================
  Files        1116     1116           
  Lines       96076    96100   +24     
=======================================
+ Hits        93564    93588   +24     
  Misses       2512     2512           
Files Changed Coverage Δ
cirq-core/cirq/_compat.py 98.70% <100.00%> (+0.04%) ⬆️
cirq-core/cirq/_compat_test.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

Let us require the wrapped function to look like a coroutine.

Otherwise LGTM.

Comment thread cirq-core/cirq/_compat_test.py
@jurruti jurruti requested a review from pavoljuhas August 16, 2023 17:55
Comment thread cirq-core/cirq/_compat_test.py
@pavoljuhas pavoljuhas enabled auto-merge (squash) August 16, 2023 21:59
@pavoljuhas pavoljuhas merged commit 95c672a into quantumlib:master Aug 16, 2023
@jurruti jurruti deleted the u/urruti/async_deprecate_parameter branch August 16, 2023 23:20
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
quantumlib#6247)

* Support the deprecated_parameter decorator for asynchronous functions.
* Add assert iscoroutine to async_deprecated_parameter test

---------

Co-authored-by: Jose Urruticoechea <urruti@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants