Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 22, 2023
1 parent d1577a8 commit 53b310b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
#
# SPDX-License-Identifier: MIT

from pathlib import Path
import urllib
from tqdm import tqdm
from pathlib import Path

import pandas as pd
from tqdm import tqdm

REGION_COLS = ["geometry", "name", "x", "y", "country"]

Expand Down Expand Up @@ -252,13 +253,15 @@ def aggregate_costs(n, flatten=False, opts=None, existing_only=False):


def progress_retrieve(url, file):

with tqdm(unit='B', unit_scale=True, unit_divisor=1024, miniters=1, dynamic_ncols=True) as t:
with tqdm(
unit="B", unit_scale=True, unit_divisor=1024, miniters=1, dynamic_ncols=True
) as t:

def update_to(b=1, bsize=1, tsize=None):
if tsize is not None:
t.total = tsize
t.update(b * bsize - t.n)

urllib.request.urlretrieve(url, file, reporthook=update_to)


Expand Down

0 comments on commit 53b310b

Please sign in to comment.