Skip to content

Commit

Permalink
Improve current ruff rules (#1720)
Browse files Browse the repository at this point in the history
* improve current ruff rules

* rm comments

* fix lengths

* trim
  • Loading branch information
juanitorduz authored Jan 16, 2024
1 parent c2b9e87 commit f6d118d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions numpyro/infer/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,10 +723,10 @@ def print_summary(self, prob=0.9, exclude_deterministic=True):

def transfer_states_to_host(self):
"""
Reduce the memory footprint of collected samples by transfering them to the host device.
Reduce the memory footprint of collected samples by transfering them to the host device.
"""
self._states = device_get(self._states)
self._states_flat = device_get(self._states_flat)
self._states_flat = device_get(self._states_flat)

def __getstate__(self):
state = self.__dict__.copy()
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ line-length = 88
indent-width = 4

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# We also add isort.
select = ["E4", "E7", "E9", "F", "I"]
select = ["E", "F", "I", "W"]
ignore = ["E203"]

# Allow fix for all enabled rules (when `--fix`) is provided.
Expand All @@ -47,6 +45,9 @@ unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.pycodestyle]
max-line-length = 120

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
Expand Down

0 comments on commit f6d118d

Please sign in to comment.