Switch to ruff (#1939)

* `isort` -> `ruff`

* `pylint` -> `ruff`

* Remove line

* More minor cleanup

* Better documentation for rules we are enabling

* Fix gitignore, run black

* vscode settings

---------

Co-authored-by: Matt Tancik <mattt4001@gmail.com>
This commit is contained in:
Brent YiandMatt Tancik authored and GitHub committed 2023-05-17 10:08:14 -07:00
1 parent 814db32ec4
commit d542646c72
79 files changed
+158 -237

No files matched your search

+2 -7
View File
@@ -3,11 +3,6 @@ Test pipeline
"""
from pathlib import Path
# pylint: disable=too-few-public-methods
# pylint: disable=no-self-use
# pylint: disable=missing-class-docstring
# pylint: disable=unused-argument
# pylint: disable=abstract-method
import torch
from torch import nn
@@ -77,13 +72,13 @@ def test_load_state_dict():
)
pipeline = VanillaPipeline(config, "cpu")
state_dict = pipeline.state_dict()
state_dict["_model.param"].mul_(2) # pylint: disable=unsubscriptable-object
state_dict["_model.param"].mul_(2)
pipeline.load_pipeline(state_dict, 0)
assert was_called
assert pipeline.model.param[0].item() == 2
# preparation for another test
state_dict["_model.param"].mul_(2) # pylint: disable=unsubscriptable-object
state_dict["_model.param"].mul_(2)
was_called = False
# pretends to be a DDP checkpoint
ddp_state_dict = {}