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

Enforce passing by keyword argument in QNode and qml.execute #6610

Merged
merged 9 commits into from
Nov 27, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Nov 19, 2024

Context:

Passing too many arguments positionally is error prone. It can be difficult to remember what the proper order of the arguements is, and it can be easy to reorder keyword arguments.

Description of the Change:

Start mandating that various keyword arguments are passed as keyword arguments in QNode and qml.execute

Benefits:

We forbid entire classes of mistakes.

Possible Drawbacks:

Related GitHub Issues:

@albi3ro albi3ro changed the title enforce passing by keyword argument Enforce passing by keyword argument in QNode and qml.execute Nov 19, 2024
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.65%. Comparing base (2d074cc) to head (b0f778d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6610      +/-   ##
==========================================
- Coverage   99.65%   99.65%   -0.01%     
==========================================
  Files         455      455              
  Lines       42821    42820       -1     
==========================================
- Hits        42672    42671       -1     
  Misses        149      149              

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

@andrijapau andrijapau self-requested a review November 27, 2024 16:18
Copy link
Contributor

@andrijapau andrijapau left a comment

Choose a reason for hiding this comment

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

Looks good to me! Nice clean-up 🚀

@albi3ro albi3ro enabled auto-merge (squash) November 27, 2024 16:23
@mudit2812
Copy link
Contributor

I'm excited to find out how many tests will need to be updated 😅

@albi3ro
Copy link
Contributor Author

albi3ro commented Nov 27, 2024

I'm excited to find out how many tests will need to be updated 😅

exactly zero 😆

@albi3ro albi3ro merged commit 672ba48 into master Nov 27, 2024
46 checks passed
@albi3ro albi3ro deleted the enforce-keyword-args branch November 27, 2024 19:54
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