PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.38k stars 607 forks source link

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

Closed albi3ro closed 2 days ago

albi3ro commented 1 week ago

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:

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mudit2812 commented 2 days ago

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

albi3ro commented 2 days ago

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

exactly zero 😆