Skip to content

Commit e7595a3

Browse files
authored
♻️ Refactor EquivalenceCheckingManager and 📝✨ Revamp Documentation (#566)
## Description This pull request includes several enhancements and updates across the project and associated documentation: 1. Updated dependencies such as `mqt-core` and pre-commit hooks to their latest versions. 2. Refactored `EquivalenceCheckingManager` to streamline its public interface by removing redundant methods. 2. Modernized project documentation and added a citation file for referencing. 3. Improved the structure of Python tests and slightly revamped the Python package with better documentation. 4. Adjusted Python bindings by moving documentation to stubs and refined counterexample handling for better flexibility. 5. Incorporated smaller code quality improvements. 6. Updated the Read the Docs (RtD) build configuration. This contains some breaking changes on the C++ as well as the Python side. However, these should simplify the usage of the library and generally reduce the size of the code base. With the 3.0 release coming up, this is the time for making such changes. At least locally, it also looks like this will fix #546. That still needs to be verified though. ## Checklist: - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines
2 parents e3cb6cd + 35cf328 commit e7595a3

File tree

96 files changed

+3571
-3774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3571
-3774
lines changed

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FormatStyle: file
22

33
Checks: |
4-
boost-*,
54
bugprone-*,
65
-bugprone-easily-swappable-parameters,
76
-bugprone-unchecked-optional-access,

.github/contributing.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Contributing
2+
3+
Thank you for your interest in contributing to this project.
4+
We value contributions from people with all levels of experience.
5+
In particular if this is your first pull request not everything has to be perfect.
6+
We will guide you through the process.
7+
8+
We use GitHub to [host code](https://github.com/cda-tum/mqt-core), to [track issues and feature requests](https://github.com/cda-tum/mqt-core/issues), as well as accept [pull requests](https://github.com/cda-tum/mqt-core/pulls).
9+
See <https://docs.github.com/en/get-started/quickstart> for a general introduction to working with GitHub and contributing to projects.
10+
11+
## Types of Contributions
12+
13+
You can contribute in several ways:
14+
15+
- 🐛 Report Bugs
16+
: Report bugs at <https://github.com/cda-tum/mqt-qcec/issues> using the _🐛 Bug report_ issue template. Please make sure to fill out all relevant information in the respective issue form.
17+
18+
- 🐛 Fix Bugs
19+
: Look through the [GitHub Issues](https://github.com/cda-tum/mqt-qcec/issues) for bugs. Anything tagged with "bug" is open to whoever wants to try and fix it.
20+
21+
- ✨ Propose New Features
22+
: Propose new features at <https://github.com/cda-tum/mqt-qcec/issues> using the _✨ Feature request_ issue template. Please make sure to fill out all relevant information in the respective issue form.
23+
24+
- ✨ Implement New Features
25+
: Look through the [GitHub Issues](https://github.com/cda-tum/mqt-qcec/issues) for features. Anything tagged with "feature" or "enhancement" is open to whoever wants to implement it. We highly appreciate external contributions to the project.
26+
27+
- 📝 Write Documentation
28+
: MQT QCEC could always use some more documentation, and we appreciate any help with that.
29+
30+
## Get Started 🎉
31+
32+
Ready to contribute? Check out the {doc}`Development Guide <development_guide>` to set up MQT QCEC for local development and learn about the style guidelines and conventions used throughout the project.
33+
34+
We value contributions from people with all levels of experience.
35+
In particular, if this is your first PR, not everything has to be perfect.
36+
We will guide you through the PR process.
37+
Nevertheless, please try to follow the guidelines below as well as you can to help make the PR process quick and smooth.
38+
39+
## Core Guidelines
40+
41+
- ["Commit early and push often"](https://www.worklytics.co/blog/commit-early-push-often).
42+
- Write meaningful commit messages, preferably using [gitmoji](https://gitmoji.dev) for additional context.
43+
- Focus on a single feature or bug at a time and only touch relevant files. Split multiple features into separate contributions.
44+
- Add tests for new features to ensure they work as intended. Document new features appropriately.
45+
- Add tests for bug fixes to demonstrate that the bug has been resolved.
46+
- Document your code thoroughly and ensure it is readable.
47+
- Keep your code clean by removing debug statements, leftover comments, and unrelated code.
48+
- Check your code for style and linting errors before committing.
49+
- Follow the project's coding standards and conventions.
50+
- Be open to feedback and willing to make necessary changes based on code reviews.
51+
52+
## Pull Request Workflow
53+
54+
- Create PRs early. It is ok to create work-in-progress PRs. You may mark these as draft PRs on GitHub.
55+
- Describe your PR with a descriptive title, reference any related issues by including the issue number in the PR description, and add a comprehensive description of the changes. Follow the provided PR template and do not delete any sections, except for the issue reference if your PR is not related to an issue.
56+
- Whenever a PR is created or updated, several workflows on all supported platforms and versions of Python are executed. These workflows ensure that the project still builds, all tests pass, the code is properly formatted, and no new linting errors are introduced. Your PR must pass all these continuous integration (CI) checks before it can be merged.
57+
- Once your PR is ready, change it from a draft PR to a regular PR and request a review from one of the project maintainers. Only request a review once you are done with your changes and the PR is ready to be reviewed. If you are unsure whether your PR is ready, ask in the PR comments. If you are a first-time contributor, request a review from one of the maintainers by mentioning them in a comment on the PR.
58+
- If your PR gets a "Changes requested" review, address the feedback and update your PR by pushing to the same branch. Do not close the PR and open a new one. Respond to review comments on the PR (e.g., with "done 👍" or "done in @<commit>") to let the reviewer know that you have addressed the feedback. Note that reviewers do not get a notification if you just react to the review comment with an emoji. Write a comment to notify the reviewer. Do not resolve the review comments yourself. The reviewer will mark the comments as resolved once they are satisfied with the changes.
59+
- Be sure to re-request a review once you have made changes after a code review so that maintainers know that the requests have been addressed.
60+
- No need to squash commits before merging; we usually squash them to keep the history clean. We only merge without squashing if the commit history is clean and meaningful. Avoid rebasing or force-pushing your PR branch before merging, as it complicates reviews. You can rebase or clean up commits after addressing all review comments if desired.
61+
62+
Here are some tips for finding the cause of certain failures:
63+
64+
- If any of the `CI / 🇨‌ Test` checks fail, this indicates build errors or test failures in the C++ part of the code base. Look through the respective logs on GitHub for any error or failure messages.
65+
- If any of the `CI / 🐍 Test` checks fail, this indicates build errors or test failures in the Python part of the code base. Look through the respective logs on GitHub for any error or failure messages.
66+
- If any of the `codecov/\*` checks fail, this means that your changes are not appropriately covered by tests or that the overall project coverage decreased too much. Ensure that you include tests for all your changes in the PR.
67+
- If `cpp-linter` comments on your PR with a list of warnings, these have been raised by `clang-tidy` when checking the C++ part of your changes for warnings or style guideline violations. The individual messages frequently provide helpful suggestions on how to fix the warnings. If you don't see any messages, but the `🇨‌ Lint / 🚨 Lint` check is red, click on the `Details` link to see the full log of the check and a step summary.
68+
- If the `pre-commit.ci` check fails, some of the `pre-commit` checks failed and could not be fixed automatically by the _pre-commit.ci_ bot. Such failures are most likely related to the Python part of the code base. The individual log messages frequently provide helpful suggestions on how to fix the warnings.
69+
- If the `docs/readthedocs.org:\*` check fails, the documentation could not be built properly. Inspect the corresponding log file for any errors.
70+
71+
---
72+
73+
This document was inspired by and partially adapted from
74+
75+
- <https://matplotlib.org/stable/devel/coding_guide.html>
76+
- <https://opensource.creativecommons.org/contributing-code/pr-guidelines/>
77+
- <https://yeoman.io/contributing/pull-request.html>
78+
- <https://github.com/scikit-build/scikit-build>

.github/contributing.rst

Lines changed: 0 additions & 81 deletions
This file was deleted.

.github/support.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Support
2+
3+
If you are stuck with a problem using MQT QCEC or have questions, please get in touch at our [Issues](https://github.com/cda-tum/mqt-qcec/issues) or [Discussions](https://github.com/cda-tum/mqt-qcec/discussions). We'd love to help.
4+
5+
You can save time by following this procedure when reporting a problem:
6+
7+
- Do try to solve the problem on your own first.
8+
- Search through past [Issues](https://github.com/cda-tum/mqt-qcec/issues) and [Discussions](https://github.com/cda-tum/mqt-qcec/discussions) to see if someone else already had the same problem.
9+
- Before filing a bug report, try to create a minimal working example (MWE) that reproduces the problem. It is much easier to identify the cause for the problem if a handful of lines suffice to show that something is not working.
10+
11+
You can also always reach us at [quantum.cda@xcit.tum.de](mailto:quantum.cda@xcit.tum.de).

.github/support.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ repos:
107107
- nox
108108
- numpy
109109
- pytest
110-
- mqt.core>=3.0.0b4
110+
- mqt.core>=3.0.0b6
111111

112112
# Check for spelling
113113
- repo: https://github.com/crate-ci/typos
@@ -144,3 +144,21 @@ repos:
144144
rev: 2025.02.24
145145
hooks:
146146
- id: validate-pyproject
147+
148+
# Tidy up BibTeX files
149+
- repo: https://github.com/FlamingTempura/bibtex-tidy
150+
rev: v1.14.0
151+
hooks:
152+
- id: bibtex-tidy
153+
args:
154+
[
155+
"--align=20",
156+
"--curly",
157+
"--months",
158+
"--blank-lines",
159+
"--sort",
160+
"--strip-enclosing-braces",
161+
"--sort-fields",
162+
"--trailing-commas",
163+
"--remove-empty-fields",
164+
]

.readthedocs.yaml

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
11
version: 2
22

33
formats:
4-
# - pdf
4+
- pdf
55
- htmlzip
66

77
build:
88
os: ubuntu-24.04
99
tools:
1010
python: "3.12"
11-
commands:
12-
# Skip docs build if the commit message contains "skip ci"
13-
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viq "skip ci") || exit 183
14-
# Skip docs build if there are no changes related to docs
15-
- |
16-
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml src/mqt/ src/python include/*/python .github/contributing* .github/support*;
17-
then
18-
exit 183;
19-
fi
20-
# Set up uv and a virtual environment
21-
- asdf plugin add uv
22-
- asdf install uv latest
23-
- asdf global uv latest
24-
# Unshallow the git clone and fetch tags to get proper version information
25-
- git fetch --unshallow --tags
26-
# Run the html builder
27-
- uv run --frozen --no-dev --group docs -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs/source $READTHEDOCS_OUTPUT/html
28-
# Run the htmlzip builder and create a zip file
29-
- uv run --frozen --no-dev --group docs -m sphinx -T -b dirhtml -d docs/_build/doctrees -D language=en docs/source docs/_build/dirhtml
30-
- mkdir -p $READTHEDOCS_OUTPUT/htmlzip
31-
- zip -r $READTHEDOCS_OUTPUT/htmlzip/html.zip docs/_build/dirhtml/*
32-
# Run the latex builder and create a pdf file
33-
# - uv run --frozen --no-dev --group docs -m sphinx -T -b latex -d docs/_build/doctrees -D language=en docs/source docs/_build/latex
34-
# - cd docs/_build/latex && latexmk -pdf -f -dvi- -ps- -interaction=nonstopmode -jobname=$READTHEDOCS_PROJECT
35-
# - mkdir -p $READTHEDOCS_OUTPUT/pdf
36-
# - cp docs/_build/latex/$READTHEDOCS_PROJECT.pdf $READTHEDOCS_OUTPUT/pdf/$READTHEDOCS_PROJECT.pdf
37-
38-
sphinx:
39-
configuration: docs/conf.py
11+
apt_packages:
12+
- graphviz
13+
- inkscape
14+
jobs:
15+
post_checkout:
16+
# Skip docs build if the commit message contains "skip ci"
17+
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viq "skip ci") || exit 183
18+
# Skip docs build if there are no changes related to docs
19+
- |
20+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml src/mqt/ src/python include/*/python .github/contributing* .github/support*;
21+
then
22+
exit 183;
23+
fi
24+
# Unshallow the git clone and fetch tags to get proper version information
25+
- git fetch --unshallow --tags
26+
pre_build:
27+
# Set up uv
28+
- asdf plugin add uv
29+
- asdf install uv latest
30+
- asdf global uv latest
31+
build:
32+
html:
33+
- uv run --frozen --no-dev --group docs -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
34+
htmlzip:
35+
- uv run --frozen --no-dev --group docs -m sphinx -T -b dirhtml -d docs/_build/doctrees -D language=en docs docs/_build/dirhtml
36+
- mkdir -p $READTHEDOCS_OUTPUT/htmlzip
37+
- zip -r $READTHEDOCS_OUTPUT/htmlzip/html.zip docs/_build/dirhtml/*
38+
pdf:
39+
- uv run --frozen --no-dev --group docs -m sphinx -T -b latex -d docs/_build/doctrees -D language=en docs docs/_build/latex
40+
- cd docs/_build/latex && latexmk -pdf -f -dvi- -ps- -interaction=nonstopmode -jobname=$READTHEDOCS_PROJECT
41+
- mkdir -p $READTHEDOCS_OUTPUT/pdf
42+
- cp docs/_build/latex/$READTHEDOCS_PROJECT.pdf $READTHEDOCS_OUTPUT/pdf/$READTHEDOCS_PROJECT.pdf

0 commit comments

Comments
 (0)