-
Notifications
You must be signed in to change notification settings - Fork 15
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
Reduce warnings in tests #1066
Comments
Remove also warning:
|
No, do not remove this warning. It is telling the user important information that their config file is misconfigured. This is the intended functionality and should remain in place. |
@lewisblake Sorry, to disagree. There are two things which make this warning wrong:
|
@lewisblake Reading the manual of pydantic: https://docs.pydantic.dev/latest/concepts/conversion_table/, pydantic automatically converts iterators to tuples as one would expect in python. Above mentioned warning does not come from a modellers cfg-file, but must be generated by an error inside of the EvalSetup/CollocationSetup (or another class using BaseModel). The code below highlights the problem. An iterator given to a tuple field in from pydantic import BaseModel, field_validator
class Years(BaseModel):
years: tuple[int, ...] = []
cfg = {"years": range(2022, 2024)}
ys = Years(**cfg)
ys.model_dump()
print(ys.years)
# (2022, 2023)
ys2 = Years()
# []
ys2.model_dump()
# Pydantic serializer warnings:
# Expected `tuple[int, ...]` but got `list` - serialized value may not be as expected |
Yes, we knew the issue was in |
I've just seen a new iris-warning:
|
Realted to #1490 |
This issue is a long term issue to address warnings appearing in the code, i.e. caused by deprecations.
Checklist:
pyproject.toml
turn warnings into errors, i.e. uncommentfilterwarnings
sectionpyaerocom/pyproject.toml
Lines 105 to 117 in d714b10
The text was updated successfully, but these errors were encountered: