Skip to content

Commit

Permalink
⬆️🪝 update pre-commit hooks (#209)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 →
v0.3.2](astral-sh/ruff-pre-commit@v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 →
v1.9.0](pre-commit/mirrors-mypy@v1.8.0...v1.9.0)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] committed Mar 13, 2024
1 parent e6b5773 commit 38d0f7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ repos:
types_or: [yaml, markdown, html, css, javascript, json]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
rev: v0.3.2
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -72,7 +72,7 @@ repos:
additional_dependencies: [black==23.*]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
files: ^(src|tests)
Expand Down
17 changes: 10 additions & 7 deletions src/mqt/predictor/rl/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,16 @@ def handle_downloading_model(download_url: str, model_name: str) -> None:
total_length = int(r.headers.get("content-length")) # type: ignore[arg-type]
fname = str(get_path_trained_model() / (model_name + ".zip"))

with Path(fname).open(mode="wb") as f, tqdm(
desc=fname,
total=total_length,
unit="iB",
unit_scale=True,
unit_divisor=1024,
) as bar:
with (
Path(fname).open(mode="wb") as f,
tqdm(
desc=fname,
total=total_length,
unit="iB",
unit_scale=True,
unit_divisor=1024,
) as bar,
):
for data in r.iter_content(chunk_size=1024):
size = f.write(data)
bar.update(size)
Expand Down

0 comments on commit 38d0f7a

Please sign in to comment.