-
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
Ipc forests #746
Ipc forests #746
Conversation
# Conflicts: # pyaerocom/aeroval/glob_defaults.py
# Conflicts: # pyaerocom/aeroval/glob_defaults.py
The reading of the variable fakedryo3 fails in the EBAS reader:
|
from __future__ import annotations |
I updated the comment meanwhile, but yes, some of Daniel's code is using Python3.10 features and was never tested on the earlier version we also still support. |
# Conflicts: # pyaerocom/aeroval/glob_defaults.py
# Conflicts: # pyaerocom/aeroval/glob_defaults.py # pyaerocom/molmasses.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR extends the EBAS variables with many helper functions for derived quantities. However, I do not see the tests for those helper fuctions.
"seasonal": {"obs": deepcopy(yeardict), "mod": deepcopy(yeardict)}, | ||
"yearly": {"obs": deepcopy(yeardict), "mod": deepcopy(yeardict)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the need for deepcopy
to create different copies of the same empty dictionary, but would not be better to use collections.defaultdict
(see docs)?
Here is how it looks like with collections.defaultdict
from collections import defaultdict
...
ts_data = {
"time": time,
"seasonal": {"obs": defaultdict(dict), "mod": defaultdict(dict)},
"yearly": {"obs": defaultdict(dict), "mod": defaultdict(dict)},
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did not know about defaultdict, but did you see the init of yeardict
?
pyaerocom/pyaerocom/aeroval/coldatatojson_helpers.py
Lines 422 to 425 in d0b18cd
years = list(repw_res["seasonal"].year.values) | |
yeardict = {} | |
for year in years: | |
yeardict[f"{year}"] = {} |
yeardict
has some predifined keys which wouldn't be in your defaultdict(dict)
, right?
# Conflicts: # pyaerocom/aeroval/glob_defaults.py # pyaerocom/data/variables.ini # tests/test_varcollection.py
Adding data to the EBAS test dataset is a pain and takes hours to do. I have added some of the new variables to |
I'm fine with the extra tests |
Reader for IPC Forests data for deposition