Skip to content

Commit

Permalink
bump: pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nstarman authored and patrick-kidger committed Jun 2, 2024
1 parent f5736cf commit b872ca8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
rev: v0.4.7
hooks:
- id: ruff # linter
types_or: [ python, pyi, jupyter ]
args: [ --fix ]
- id: ruff-format # formatter
types_or: [ python, pyi, jupyter ]
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.315
rev: v1.1.365
hooks:
- id: pyright
additional_dependencies: ["equinox", "pytest", "jax", "jaxtyping", "plum-dispatch"]
5 changes: 3 additions & 2 deletions docs/examples/redispatch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@
"outputs": [],
"source": [
"@quax.register(jax.lax.dot_general_p)\n",
"def _(x: LoraArray, y: SomeKindOfSparseVector, *, dimension_numbers, **params):\n",
" ... # some implementation here"
"def _(\n",
" x: LoraArray, y: SomeKindOfSparseVector, *, dimension_numbers, **params\n",
"): ... # some implementation here"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ include = ["quax/*"]
[tool.pytest.ini_options]
addopts = "--jaxtyping-packages=quax,beartype.beartype(conf=beartype.BeartypeConf(strategy=beartype.BeartypeStrategy.On))"

[tool.ruff]
[tool.ruff.lint]
select = ["E", "F", "I001"]
ignore = ["E402", "E721", "E731", "E741", "F722"]
ignore-init-module-imports = true
fixable = ["I001", "F401"]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
lines-after-imports = 2
extra-standard-library = ["typing_extensions"]
Expand Down
2 changes: 1 addition & 1 deletion quax/examples/zero/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _(lhs: Zero, rhs: Zero, **kwargs) -> Zero:
def _integer_pow(x: Zero, *, y: int) -> Union[Array, Zero]:
# Zero is a special case, because 0^0 = 1.
if y == 0:
return jnp.ones(x.shape, x.dtype)
return jnp.ones(x.shape, x.dtype) # pyright: ignore

# Otherwise, we can just return a zero.
# Inf and NaN are not integers, so we don't need to worry about them.
Expand Down

0 comments on commit b872ca8

Please sign in to comment.