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

Adds better definition of filters. Adds tqdm to read_pyaro #1335

Merged
merged 2 commits into from
Sep 5, 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
2 changes: 1 addition & 1 deletion pyaerocom/io/pyaro/pyaro_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PyaroConfig(BaseModel):
name: str
data_id: str
filename_or_obj_or_url: str
filters: dict[str, dict[str, list[str]]]
filters: dict[str, dict[str, list[str]] | dict[str, list[tuple]]]
name_map: dict[str, str] | None = None # no Unit conversion option

##########################
Expand Down
6 changes: 3 additions & 3 deletions pyaerocom/io/pyaro/read_pyaro.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from copy import deepcopy
from typing import NewType

from tqdm import tqdm

import numpy as np
from pyaro import list_timeseries_engines, open_timeseries
from pyaro.timeseries import Data, Reader, Station
Expand Down Expand Up @@ -161,9 +163,7 @@ def _convert_to_ungriddeddata(self, pyaro_data: dict[str, Data]) -> UngriddedDat
metadata_idx = 0
for var, var_data in pyaro_data.items():
size = var_size[var]
for i in range(
0, size
): # The 1 start is a temp fix for the empty first row of the current Data implementation from pyaro
for i in tqdm(range(size), disable=None):
data_line = var_data[i]
current_station = data_line["stations"]

Expand Down