mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-28 03:50:11 +08:00
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:
1 parent
814db32ec4
commit
d542646c72
79 files changed
+158
-237
No files matched your search
@@ -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 = {}
|
||||
|
||||
Reference in new issue
Block a user