Skip to content

Commit

Permalink
lint: unify setting in pyproject.toml (#583)
Browse files Browse the repository at this point in the history
* lint: unify setting in `pyproject.toml`

* apply pre-commit
  • Loading branch information
Borda authored Jul 12, 2024
1 parent bf4d667 commit 347e8a9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
7 changes: 0 additions & 7 deletions .isort.cfg

This file was deleted.

3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
hooks:
- id: autoflake
name: autoflake (python)
args: ['--in-place', '--remove-unused-variables', '--remove-all-unused-imports', '--ignore-init-module-imports']
args: ['--in-place']

- repo: https://github.com/pycqa/isort
rev: 5.12.0
Expand All @@ -18,7 +18,6 @@ repos:
hooks:
- id: black
name: black formatter
args: ['--line-length=120', '--target-version=py37', '--target-version=py38', '--target-version=py39','--target-version=py310']

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
Expand Down
1 change: 0 additions & 1 deletion eval/vbench/calc_vbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import time

import torch

from vbench import VBench

full_info_path = "eval/vbench/VBench_full_info.json"
Expand Down
1 change: 0 additions & 1 deletion eval/vbench_i2v/calc_vbench_i2v.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import time

import torch

from vbench import VBench
from vbench2_beta_i2v import VBenchI2V

Expand Down
1 change: 0 additions & 1 deletion opensora/datasets/read_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def _read_from_stream(
stream_name: Dict[str, Optional[Union[int, Tuple[int, ...], List[int]]]],
filename: Optional[str] = None,
) -> List["av.frame.Frame"]:

if pts_unit == "sec":
# TODO: we should change all of this from ground up to simply take
# sec and convert to MS in C++
Expand Down
2 changes: 1 addition & 1 deletion opensora/schedulers/rf/rectified_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def timestep_transform(
for key in ["height", "width", "num_frames"]:
if model_kwargs[key].dtype == torch.float16:
model_kwargs[key] = model_kwargs[key].float()

t = t / num_timesteps
resolution = model_kwargs["height"] * model_kwargs["width"]
ratio_space = (resolution / base_resolution).sqrt()
Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tool.autoflake]
remove-unused-variables = true
remove-all-unused-imports = true
ignore-init-module-imports = true

[tool.isort]
line_length = 120
multi_line_output = 3
include_trailing_comma = true
ignore_comments = true
profile = "black"
honor_noqa = true

[tool.black]
line-length = 120
target-version = ["py37", "py38", "py39", "py310"]

0 comments on commit 347e8a9

Please sign in to comment.