Skip to content

Commit

Permalink
Remove enable_progressbar arg in favour of disable=None
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Nov 27, 2024
1 parent 26634f7 commit b198eaf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/pyaro_readers/eeareader/EEATimeseriesReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ def _read_hourly_files(
datapaths: list[Path],
variable: int,
metadata: polars.DataFrame,
progressbar_enabled: bool,
filters: _Filters,
) -> polars.DataFrame:
dataset = polars.DataFrame(
Expand All @@ -225,7 +224,7 @@ def _read_hourly_files(
}
)

pbar = tqdm(datapaths, disable=not progressbar_enabled)
pbar = tqdm(datapaths, disable=None)
for file in pbar:
pbar.set_description(f"Processing hourly {file.name:>54}")
dataset.vstack(_read(file, filters.pyarrow_filters_hourly), in_place=True)
Expand Down Expand Up @@ -281,7 +280,6 @@ def _read_daily_files(
datapaths: list[Path],
variable: int,
metadata: polars.DataFrame,
progressbar_enabled: bool,
filters: _Filters,
) -> polars.DataFrame:
dataset = polars.DataFrame(
Expand All @@ -301,7 +299,7 @@ def _read_daily_files(
}
)

pbar = tqdm(datapaths, disable=not progressbar_enabled)
pbar = tqdm(datapaths, disable=None)
for file in pbar:
pbar.set_description(f"Processing daily {file.name:>54}")
dataset.vstack(_read(file, filters.pyarrow_filters_daily), in_place=True)
Expand Down Expand Up @@ -375,7 +373,6 @@ def __init__(
self,
filename_or_obj_or_url,
filters=[],
enable_progressbar: bool = False,
dataset: Literal["historical", "verified", "unverified"] = "unverified",
station_area: str | list[str] = "all",
station_type: str | list[str] = "all",
Expand Down Expand Up @@ -409,7 +406,6 @@ def __init__(
), "Pollutants are not unique"

self._data_directory = data_directory
self._progressbar_enabled = enable_progressbar

if isinstance(station_area, str):
self._station_area = [station_area]
Expand Down Expand Up @@ -512,14 +508,12 @@ def _read(
[p[1] for p in paths if p[0] == "hourly"],
variable_id,
self._metadata,
self._progressbar_enabled,
filters,
)
daily_dataset = _read_daily_files(
[p[1] for p in paths if p[0] == "daily"],
variable_id,
self._metadata,
self._progressbar_enabled,
filters,
)

Expand Down

0 comments on commit b198eaf

Please sign in to comment.