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

Move GlobalBackend check to backends.__init__.py #1193

Merged
merged 5 commits into from
Feb 6, 2024
Merged

Conversation

renatomello
Copy link
Contributor

@renatomello renatomello commented Feb 6, 2024

This replaces all the repeated lines like:

if backend is None:  # pragma: no cover
    backend = GlobalBackend()

by a function in backends.__init__.py

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

@renatomello renatomello added this to the Qibo 0.2.5 milestone Feb 6, 2024
@renatomello renatomello self-assigned this Feb 6, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f67dc84) 100.00% compared to head (6321293) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1193   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           69        69           
  Lines        10107     10166   +59     
=========================================
+ Hits         10107     10166   +59     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@alecandido alecandido left a comment

Choose a reason for hiding this comment

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

The change itself is good to me, this pattern was really ubiquitous.

Copy link
Contributor

@MatteoRobbiati MatteoRobbiati left a comment

Choose a reason for hiding this comment

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

Thanks.

@renatomello renatomello changed the title Move to GlobalBackend check to backends.__init__.py Move GlobalBackend check to backends.__init__.py Feb 6, 2024
@renatomello renatomello added this pull request to the merge queue Feb 6, 2024
Merged via the queue into master with commit 330f1bb Feb 6, 2024
@renatomello renatomello deleted the backend branch February 6, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants