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 get_engine and deprecate engine_from_environment #3151

Merged
merged 5 commits into from
Jul 22, 2020
Merged

Add get_engine and deprecate engine_from_environment #3151

merged 5 commits into from
Jul 22, 2020

Conversation

dabacon
Copy link
Collaborator

@dabacon dabacon commented Jul 18, 2020

#2767 introduced get_engine_sampler. This adds get_engine via a similar pattern, and in particular uses the same shared environment variable for projects, GOOGLE_PROJECT_ID.

Also

  • deprecates engine_from_environment which used a different environment variable and a different nomenclature. It also fixes a bug in this methods id.
  • corrects a typo in the doc of get_engine_sampler
  • Gives the a sensible small string for an Engine object.

@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Jul 18, 2020
@dabacon dabacon changed the title Getengine Add get_engine and deprecate engine_from_environment Jul 18, 2020
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.

nice!

timeout: Optional[int] = None,
context: Optional[EngineContext] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is technically a breaking change :) any reason for the re-ordering?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Users should not be using context directly, so moving it down helps reenforce this (also updated doc string to say this). And yeah this is technically breaking, but hopefully people aren't using context.

@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 21, 2020
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 21, 2020

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 21, 2020
@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 21, 2020
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 21, 2020

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 21, 2020
@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 21, 2020
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 21, 2020

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 21, 2020
@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 21, 2020
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 21, 2020

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 21, 2020
@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 22, 2020
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 22, 2020
@CirqBot CirqBot merged commit 74c0aa8 into quantumlib:master Jul 22, 2020
@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 Jul 22, 2020
@balopat balopat added the BREAKING CHANGE For pull requests that are important to mention in release notes. label Jul 28, 2020
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
quantumlib#2767 introduced `get_engine_sampler`.  This adds `get_engine` via a similar pattern, and in particular uses the same shared environment variable for projects, GOOGLE_PROJECT_ID.

Also
* deprecates `engine_from_environment` which used a different environment variable and a different nomenclature.  It also fixes a bug in this methods id.
* corrects a typo in the doc of `get_engine_sampler`
* Gives the a sensible small string for an Engine object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE For pull requests that are important to mention in release notes. cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants