Skip to content

Commit

Permalink
Update Ruff and incorporate changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Christie committed Jul 15, 2024
1 parent 34f6223 commit 8fb0f9a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
types: [python]
- id: ruff
name: ruff
entry: ruff
entry: ruff check
args: ["--exit-non-zero-on-fix"]
require_serial: true
language: system
Expand Down
53 changes: 22 additions & 31 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ black = "^23.1.0"
isort = "^5.12.0"
pylint = "^2.17.1"
nox = "^2022.11.21"
ruff = "^0.0.259"
ruff = "~0"
flax = ">=0.7.5"
pre-commit = "^3.2.2"
nbstripout = "^0.6.1"
Expand Down Expand Up @@ -110,10 +110,13 @@ xfail_strict = true
[tool.ruff] # https://github.com/charliermarsh/ruff
fix = true
cache-dir = "~/.cache/ruff"
dummy-variable-rgx = "^_$"
exclude = ["docs/"]
ignore-init-module-imports = true
line-length = 88
src = ["gpjax", "tests"]
target-version = "py38"

[tool.ruff.lint]
dummy-variable-rgx = "^_$"
select = [
# pyflakes
"F",
Expand Down Expand Up @@ -147,21 +150,19 @@ ignore = [
# do not assign a lambda expression, use a def
"E731",
"E501",
"PGH001",
"S307",
"RET504",
"S101",
"F722",
'PLR2004',
"PLR0913",
]
unfixable = ["ERA001", "F401", "F841", "T201", "T203"]
src = ["gpjax", "tests"]
target-version = "py38"

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"gpjax/__init__.py" = ['I', 'F401', 'E402', 'D104']
"gpjax/progress_bar.py" = ["TCH004"]
"gpjax/scan.py" = ["PLR0913"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ def test_posterior_construct(
assert is_dataclass(posterior_manual)

# Ensure that the posterior is the same type in all three cases.
assert type(posterior_mul) == type(posterior_rmul)
assert type(posterior_mul) == type(posterior_manual)
assert type(posterior_mul) is type(posterior_rmul)
assert type(posterior_mul) is type(posterior_manual)

# Ensure the tree leaves are the same in all three cases.
leaves_mul = jtu.tree_leaves(posterior_mul)
Expand Down

0 comments on commit 8fb0f9a

Please sign in to comment.