Skip to content

Commit

Permalink
Merge pull request #1413 from metno/pyaro_filter_args
Browse files Browse the repository at this point in the history
Allow any argument to pyaro filters
  • Loading branch information
heikoklein authored Nov 21, 2024
2 parents 2854cd5 + 975e047 commit e36edb9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyaerocom/io/pyaro/pyaro_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
from importlib import resources
from pathlib import Path
from typing import ClassVar
from typing import ClassVar, Any

import yaml
from pydantic import BaseModel, ConfigDict
Expand All @@ -15,6 +15,8 @@

# TODO Check a validator if extra/kwarg is serializable. Either in json_repr or as a @field_validator on extra

FilterArgs = dict[str, Any]


class PyaroConfig(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True, extra="allow")
Expand All @@ -30,7 +32,7 @@ class PyaroConfig(BaseModel):
name: str
data_id: str
filename_or_obj_or_url: str | list[str] | Path | list[Path]
filters: dict[str, dict[str, list[str]] | dict[str, list[tuple]]]
filters: dict[str, FilterArgs]
name_map: dict[str, str] | None = None # no Unit conversion option

##########################
Expand Down

0 comments on commit e36edb9

Please sign in to comment.