Skip to content

Commit

Permalink
Allow any argument to filters
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Nov 21, 2024
1 parent 2854cd5 commit 975e047
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 975e047

Please sign in to comment.