Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stand-by committed Jul 19, 2024
1 parent f2ed6c2 commit c4ff2bb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
1 change: 0 additions & 1 deletion .github/workflows/all_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,4 +27,4 @@ lint-fix:
ruff check --fix ./fast_pauli/py ./tests

lint-write:
ruff format ./fast_pauli/py ./tests
ruff format ./fast_pauli/py ./tests
6 changes: 3 additions & 3 deletions fast_pauli/py/pypauli/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
19 changes: 17 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c4ff2bb

Please sign in to comment.