PennyLaneAI / qml

Introductions to key concepts in quantum programming, as well as tutorials and implementations from cutting-edge quantum computing research.
https://pennylane.ai/qml
Apache License 2.0
517 stars 183 forks source link

Introduce & run `make format` #1078

Closed vincentmr closed 3 months ago

vincentmr commented 3 months ago

Before submitting

Please complete the following checklist when submitting a PR:

When all the above are checked, delete everything above the dashed line and fill in the pull request template.


Title:

Summary: Add make format (isort + black). Run make format.

Relevant references:

Possible Drawbacks:

Related GitHub Issues:


If you are writing a demonstration, please answer these questions to facilitate the marketing process.

github-actions[bot] commented 3 months ago

👋 Hey, looks like you've updated some demos!

🐘 Don't forget to update the dateOfLastModification in the associated metadata files so your changes show up on pennylane.ai.

Please hide this comment once the field(s) are updated. Thanks!

github-actions[bot] commented 3 months ago

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.

josh146 commented 3 months ago

Hey @vincentmr! we have chosen not to isort and format the demos/tutorials, for a couple of reasons:

unless there is a motivation for doing this in the QML repo, I will close this PR for now.

vincentmr commented 3 months ago

Hey @vincentmr! we have chosen not to isort and format the demos/tutorials, for a couple of reasons:

  • Black will make formatting choices that are not always the best for readability

Being so used to read black-formatted code, I thought it might help readability in general, but I agree this could make things worse on some cases.

  • isort will reorder imports in a way that is not always best for explanation (sometimes we want to import things later in the demo)

Yes, good point.

unless there is a motivation for doing this in the QML repo, I will close this PR for now.

No problem.