diff --git a/.github/workflows/all_push.yml b/.github/workflows/all_push.yml index a1ec458..e37c887 100644 --- a/.github/workflows/all_push.yml +++ b/.github/workflows/all_push.yml @@ -34,7 +34,6 @@ jobs: OMP_NUM_THREADS: 2 CPP_TEST_DIR: build/fast_pauli/cpp/tests run: | - du ${CPP_TEST_DIR}/test_pauli_op # ctest --test-dir build --verbose # TODO not using bc of PauliOp problems on CI ./${CPP_TEST_DIR}/test_factory ./${CPP_TEST_DIR}/test_pauli diff --git a/Makefile b/Makefile index 9c355c6..8bc3d04 100644 --- a/Makefile +++ b/Makefile @@ -19,17 +19,6 @@ tests: clean: rm -rf build dist -docs-build: - cd docs && \ - python -m sphinx -T -W --keep-going -b html -d _build/doctrees -D language=en . ./html - -livehtml: - sphinx-autobuild docs docs/_build/html - -.PHONY: clean-docs -clean-docs: - rm -rf docs/html docs/_build - lint-check: ruff check ./fast_pauli/py ./tests && \ mypy ./fast_pauli/py ./tests @@ -38,4 +27,4 @@ lint-fix: ruff check --fix ./fast_pauli/py ./tests lint-write: - ruff format ./fast_pauli/py ./tests \ No newline at end of file + ruff format ./fast_pauli/py ./tests diff --git a/fast_pauli/py/pypauli/operations.py b/fast_pauli/py/pypauli/operations.py index bec1c44..bc97728 100644 --- a/fast_pauli/py/pypauli/operations.py +++ b/fast_pauli/py/pypauli/operations.py @@ -37,7 +37,7 @@ def multiply(self, state: np.ndarray) -> np.ndarray: ---- state: The input state as a numpy array. - Returns: + Returns ------- The result of multiplying the Pauli string with the state. @@ -61,7 +61,7 @@ def compose_sparse_pauli(string: str) -> tuple[np.ndarray, np.ndarray]: string: The input string representing the Pauli string. Must contain only I, X, Y, Z characters. - Returns: + Returns ------- A tuple containing the column numbers and values of the sparse matrix. @@ -120,7 +120,7 @@ def compose_sparse_diag_pauli(string) -> np.ndarray: ---- string: A Pauli string containing only 'I' and 'Z' characters. - Returns: + Returns ------- np.ndarray: diagonal values from resulting sparse matrix. diff --git a/pyproject.toml b/pyproject.toml index b02dbca..2a71fe7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,7 +109,22 @@ target-version="py38" # D - pydocstyle (https://docs.astral.sh/ruff/rules/#pydocstyle-d) # YTT - flake8-2020 (https://docs.astral.sh/ruff/rules/#flake8-2020-ytt) # ASYNC flake8-async (https://docs.astral.sh/ruff/rules/#flake8-async-async) +# B flake8-bugbear (https://docs.astral.sh/ruff/rules/#flake8-bugbear-b) +# UP flake8-bandit (https://docs.astral.sh/ruff/rules/#flake8-bandit-up) +# SIM flake8-simplify (https://docs.astral.sh/ruff/rules/#flake8-simplify-sim) -select = ["F", "E", "W", "I", "N", "D", "YTT", "ASYNC"] +select = ["F", "E", "W", "I", "N", "D", "YTT", "ASYNC", "B", "UP", "SIM"] -ignore = [] +ignore = [ + # Allow non-lowercase variable names to help the code match the math better + "N806", + # mypy doesn't support PEP695 (upgrading to `type` python keyword) + "UP040", +] + +[tool.ruff.lint.pydocstyle] +convention = "numpy" + +[tool.ruff.format] +quote-style = "double" +docstring-code-format = true