Arguments given in VarWebScaleAndColormap may not be going through pydantic
Describe the bug
There are two __init__ methods in this class. Only the second one is being used. This means that the pydantic checking is not being used. One way to test this is to try and give VarWebScaleAndColormap arguments which are not scale and colmap
- Pyaerocom version: 0.21.dev0
- Computing platform: All
- Configuration file (if applicable): NA
- Error message (if applicable): NA
Relevant PR: #1256
They aren't being passed correctly. Pydantic should've yelled at me:
from pyaerocom.aeroval.glob_defaults import VarWebScaleAndColormap
test = VarWebScaleAndColormap({"blah": {"blah": ["a", "b", "c"], "blub": ["d", "e", "f"]}})
@heikoklein just want to put this on your radar
The first argument to VarWebScaleAndColormap is an optional string/filename, not a dict. Unfortunately, the config-parser does not raise a FileNotFoundError when something strange is given. I will fix that and add more tests.
What you wanted to do is to add a dict directly by kwargs, i.e. add two asterisks:
VarWebScaleAndColormap(**{"blah": {"blah": ["a", "b", "c"], "blub": ["d", "e", "f"]}})