Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

47 disable tqdm when running non interactive #49

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ def __init__(
lines = []
_fidx = 0
members = tf.getmembers()
bar = tqdm(desc="extracting tar file...", total=len(members))
bar = tqdm(
desc="extracting tar file...",
total=len(members),
disable=None,
)
for _midx, member in enumerate(members):
if fnmatch(member.name, FILE_MASK):
bar.update(1)
Expand Down Expand Up @@ -171,7 +175,7 @@ def __init__(

gcd = Geocoder_Reverse_NE()
crd = csv.DictReader(lines, fieldnames=self._fields, delimiter=DELIMITER)
bar = tqdm(desc=tqdm_desc, total=len(lines))
bar = tqdm(desc=tqdm_desc, total=len(lines), disable=None)
for _ridx, row in enumerate(crd):
bar.update(1)
if row[SITE_NAME] != _laststatstr:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __init__(

gcd = Geocoder_Reverse_NE()
crd = csv.DictReader(lines, fieldnames=self._fields, delimiter=DELIMITER)
bar = tqdm(desc=tqdm_desc, total=len(lines))
bar = tqdm(desc=tqdm_desc, total=len(lines), disable=None)
for _ridx, row in enumerate(crd):
bar.update(1)
if row[SITE_NAME] != _laststatstr:
Expand Down
2 changes: 1 addition & 1 deletion src/pyaro_readers/harpreader/harpreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(
else:
self._files.append(file)

bar = tqdm(total=len(self._files))
bar = tqdm(total=len(self._files), disable=None)

for f_idx, _file in enumerate(self._files):
logger.info(f"Reading {_file}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(
raise ValueError(
f"Could not find any nas files in given folder {self._filename}"
)
bar = tqdm(desc=tqdm_desc, total=len(files))
bar = tqdm(desc=tqdm_desc, total=len(files), disable=None)
for file in files:
bar.update(1)
self._process_file(file, fill_country_flag)
Expand Down
2 changes: 1 addition & 1 deletion src/pyaro_readers/nilupmfebas/EbasPmfReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(
if Path(realpath).is_dir():
# search directory for files
files = list(realpath.glob(filemask))
bar = tqdm(desc=tqdm_desc, total=len(files))
bar = tqdm(desc=tqdm_desc, total=len(files), disable=None)

for _ridx, file in enumerate(files):
bar.update(1)
Expand Down
Loading