cda-tum / mqt-ddsim

MQT DDSIM - A quantum circuit simulator based on decision diagrams written in C++
https://mqt.readthedocs.io/projects/ddsim
MIT License
141 stars 30 forks source link

🚨 enable ruff's `D` code for docstrings #428

Closed burgholzer closed 2 months ago

burgholzer commented 2 months ago

Description

This PR (finally) enables ruff's D code for pydocstyle lint rules. Consequently, it fixes all the resulting warnings. Additionally, it adds rules for favoring collections.abc over typing where appropriate.

Checklist:

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 92.3%. Comparing base (043d484) to head (11913d9). Report is 1 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428/graphs/tree.svg?width=650&height=150&src=pr&token=OxwtOXYQeG&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) ```diff @@ Coverage Diff @@ ## main #428 +/- ## ======================================= - Coverage 92.3% 92.3% -0.1% ======================================= Files 37 37 Lines 2720 2719 -1 Branches 304 304 ======================================= - Hits 2512 2511 -1 Misses 208 208 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | *Carryforward flag | |---|---|---|---| | [cpp](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `94.1% <ø> (ø)` | | Carriedforward from [043d484](https://app.codecov.io/gh/cda-tum/mqt-ddsim/commit/043d484f10db8ded52b677ed7c0d1fe273e358ce?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | | [python](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `87.4% <100.0%> (-0.1%)` | :arrow_down: | | *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) to find out more. | [Files with missing lines](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [src/mqt/ddsim/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9fX2luaXRfXy5weQ==) | `100.0% <ø> (ø)` | | | [src/mqt/ddsim/deterministicnoisesimulator.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fdeterministicnoisesimulator.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9kZXRlcm1pbmlzdGljbm9pc2VzaW11bGF0b3IucHk=) | `100.0% <ø> (ø)` | | | [src/mqt/ddsim/header.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fheader.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9oZWFkZXIucHk=) | `100.0% <ø> (ø)` | | | [src/mqt/ddsim/hybridqasmsimulator.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fhybridqasmsimulator.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9oeWJyaWRxYXNtc2ltdWxhdG9yLnB5) | `90.9% <ø> (ø)` | | | [src/mqt/ddsim/hybridstatevectorsimulator.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fhybridstatevectorsimulator.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9oeWJyaWRzdGF0ZXZlY3RvcnNpbXVsYXRvci5weQ==) | `100.0% <ø> (ø)` | | | [src/mqt/ddsim/job.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fjob.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9qb2IucHk=) | `59.3% <100.0%> (ø)` | | | [src/mqt/ddsim/pathqasmsimulator.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fpathqasmsimulator.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9wYXRocWFzbXNpbXVsYXRvci5weQ==) | `51.3% <ø> (ø)` | | | [src/mqt/ddsim/pathstatevectorsimulator.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fpathstatevectorsimulator.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9wYXRoc3RhdGV2ZWN0b3JzaW11bGF0b3IucHk=) | `100.0% <ø> (ø)` | | | [src/mqt/ddsim/primitives/estimator.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fprimitives%2Festimator.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9wcmltaXRpdmVzL2VzdGltYXRvci5weQ==) | `93.2% <100.0%> (ø)` | | | [src/mqt/ddsim/primitives/sampler.py](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree&filepath=src%2Fmqt%2Fddsim%2Fprimitives%2Fsampler.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9kZHNpbS9wcmltaXRpdmVzL3NhbXBsZXIucHk=) | `100.0% <100.0%> (ø)` | | | ... and [6 more](https://app.codecov.io/gh/cda-tum/mqt-ddsim/pull/428?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | |