Introduction of informational pydoclint CI job on push and PR#446
Introduction of informational pydoclint CI job on push and PR#446emlynsg wants to merge 13 commits intoTeamGraphix:masterfrom
pydoclint CI job on push and PR#446Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #446 +/- ##
=======================================
Coverage 88.09% 88.09%
=======================================
Files 44 44
Lines 6449 6449
=======================================
Hits 5681 5681
Misses 768 768 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| [tool.ruff.lint.isort] | ||
| required-imports = ["from __future__ import annotations"] | ||
|
|
||
| [tool.pydoclint] |
There was a problem hiding this comment.
Maybe here it would be good to exclude example and test files.
I'd add check-arg-defaults as true.
The baseline option could be interesting for us!
There was a problem hiding this comment.
Yes I think exclusion for those makes sense and we can fix much later.
There was a problem hiding this comment.
Just read the docs about baseline, can't believe I missed that it sounds super handy!
| Attributes | ||
| ---------- | ||
| rho : Matrix | ||
| density matrix |
There was a problem hiding this comment.
Is there a way to consistently capitalise the first word of the parameter description?
There was a problem hiding this comment.
I'll keep investigating, but I can't find anything for now.
requirements-dev.txt
Outdated
|
|
||
| openqasm-parser>=3.1.0 | ||
| graphix-qasm-parser>=0.1.1 | ||
| # graphix-qasm-parser>=0.1.1 |
There was a problem hiding this comment.
Maybe add pydoclint to the dev requirements file ?
I made the changes to the docstrings by hand. Pydoclint would fault in some cases (e.g. name with colon and no type in the docstring), rather than just the normal warning you expect. It is one downside, but running in pre-commit from now on will avoid it entirely. |
Draft PR for presentation and discussion
This draft PR:
pydoclint, and reports on failing lines in each file of the repositorypydoclintstep (to be reactivated when we have completed standardising the docstrings of the repository)pydoclintto fail when run.Note: The graphix-qasm-parser dependency was causing the CI to fail, and was commented out.
Example output:
pydoclint report
graphix/_linalg.py— 11 violation(s)graphix/branch_selector.py— 9 violation(s)graphix/channels.py— 14 violation(s)graphix/command.py— 20 violation(s)graphix/extraction.py— 12 violation(s)graphix/flow/_find_gpflow.py— 15 violation(s)graphix/flow/core.py— 12 violation(s)graphix/fundamentals.py— 1 violation(s)graphix/graphsim.py— 25 violation(s)graphix/linalg_validations.py— 5 violation(s)graphix/measurements.py— 12 violation(s)graphix/noise_models/depolarising.py— 2 violation(s)graphix/noise_models/noise_model.py— 4 violation(s)graphix/opengraph.py— 14 violation(s)graphix/ops.py— 8 violation(s)graphix/optimization.py— 17 violation(s)graphix/parameter.py— 2 violation(s)graphix/pattern.py— 64 violation(s)graphix/pauli.py— 5 violation(s)graphix/pretty_print.py— 11 violation(s)graphix/pyzx.py— 8 violation(s)graphix/qasm3_exporter.py— 17 violation(s)graphix/random_objects.py— 21 violation(s)graphix/repr_mixins.py— 2 violation(s)graphix/sim/base_backend.py— 38 violation(s)graphix/sim/density_matrix.py— 16 violation(s)graphix/sim/statevec.py— 13 violation(s)graphix/sim/tensornet.py— 47 violation(s)graphix/simulator.py— 17 violation(s)graphix/transpiler.py— 33 violation(s)graphix/visualization.py— 24 violation(s)Violations are reported but do not fail the job.