mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 21:39:06 +08:00
Use ruff as linter and formatter (#2765)
* Switch from black to ruff format * Sort dependencies with ruff check * Run ruff format
This commit is contained in:
1 parent
69ed6d4093
commit
f0aadf9de8
83 files changed
+208
-429
No files matched your search
@@ -20,7 +20,7 @@ from __future__ import annotations
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Literal, Optional, Tuple, Callable
|
||||
from typing import Callable, Literal, Optional, Tuple
|
||||
|
||||
import torch
|
||||
import yaml
|
||||
|
||||
@@ -17,11 +17,11 @@ Miscellaneous helper code.
|
||||
"""
|
||||
|
||||
|
||||
from inspect import currentframe
|
||||
import typing
|
||||
import platform
|
||||
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
|
||||
import typing
|
||||
import warnings
|
||||
from inspect import currentframe
|
||||
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
@@ -24,28 +24,13 @@ import typing
|
||||
from collections import deque
|
||||
from contextlib import ContextDecorator, contextmanager
|
||||
from pathlib import Path
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
ContextManager,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import Any, Callable, ContextManager, Dict, List, Optional, Tuple, TypeVar, Union, overload
|
||||
|
||||
from torch.profiler import ProfilerActivity, profile, record_function
|
||||
|
||||
from nerfstudio.configs import base_config as cfg
|
||||
from nerfstudio.utils import comms
|
||||
from nerfstudio.utils.decorators import (
|
||||
check_main_thread,
|
||||
check_profiler_enabled,
|
||||
decorate_all,
|
||||
)
|
||||
from nerfstudio.utils.decorators import check_main_thread, check_profiler_enabled, decorate_all
|
||||
from nerfstudio.utils.rich_utils import CONSOLE
|
||||
|
||||
PROFILER = []
|
||||
|
||||
@@ -18,15 +18,7 @@ from contextlib import nullcontext
|
||||
from typing import Optional
|
||||
|
||||
from rich.console import Console
|
||||
from rich.progress import (
|
||||
BarColumn,
|
||||
Progress,
|
||||
ProgressColumn,
|
||||
Task,
|
||||
TaskProgressColumn,
|
||||
TextColumn,
|
||||
TimeRemainingColumn,
|
||||
)
|
||||
from rich.progress import BarColumn, Progress, ProgressColumn, Task, TaskProgressColumn, TextColumn, TimeRemainingColumn
|
||||
from rich.text import Text
|
||||
|
||||
CONSOLE = Console(width=120)
|
||||
|
||||
@@ -28,12 +28,13 @@ import comet_ml
|
||||
import torch
|
||||
import wandb
|
||||
from jaxtyping import Float
|
||||
from torch import Tensor
|
||||
from torch.utils.tensorboard import SummaryWriter
|
||||
|
||||
from nerfstudio.configs import base_config as cfg
|
||||
from nerfstudio.utils.decorators import check_main_thread, decorate_all
|
||||
from nerfstudio.utils.printing import human_format
|
||||
from nerfstudio.utils.rich_utils import CONSOLE
|
||||
from torch import Tensor
|
||||
from torch.utils.tensorboard import SummaryWriter
|
||||
|
||||
|
||||
def to8b(x):
|
||||
|
||||
Reference in new issue
Block a user