Skip to content
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

English and French metadata overhaul #1123

Merged
merged 141 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
0f06070
update HISTORY.rst
Zeitsperre Jul 7, 2022
a81d65b
English indicator metadata cleanup
Zeitsperre Jul 7, 2022
1391f65
update HISTORY.rst
Zeitsperre Jul 7, 2022
d627398
update HISTORY.rst
Zeitsperre Jul 7, 2022
b3acc28
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Jul 18, 2022
e0148c4
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Jul 21, 2022
ab5ee46
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 2, 2022
c33055b
update english indicator metadata and associated tests
Zeitsperre Aug 2, 2022
6693128
synchronize conversion indicator metadata in English and French
Zeitsperre Aug 2, 2022
fecaae9
make fixme note about the shifting of lowercase in description fields…
Zeitsperre Aug 2, 2022
0ed6000
fix CHU test
Zeitsperre Aug 2, 2022
fdd23c0
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 2, 2022
e60ce9c
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 3, 2022
e5998ce
test fixes
Zeitsperre Aug 3, 2022
664fd33
journalière to quotidienne
Zeitsperre Aug 8, 2022
6d16368
Température quotidienne min/max → Température minimale/maximale quoti…
Zeitsperre Aug 8, 2022
a876bde
percentile -> centile
Zeitsperre Aug 8, 2022
27fa913
pluvieux -> avec précipitation, less use of plural form of "temperature"
Zeitsperre Aug 8, 2022
2b6f136
Update expected translation
Zeitsperre Aug 8, 2022
e1687b7
some precipitation indicator metadata fixes, update test
Zeitsperre Aug 8, 2022
f62d864
precipitation indicators
Zeitsperre Aug 9, 2022
b2df48a
Adjust metadata of dry_spell indicators
Zeitsperre Aug 9, 2022
c09e143
Remove mention of old argument in DC and FWI attrs
aulemahal Aug 9, 2022
49e9833
add missing titles
Zeitsperre Aug 9, 2022
87b09ef
Fixes for seaIce, wind, snow, and precipitation indicators
Zeitsperre Aug 9, 2022
554ac91
Fixes for streamflow and synoptic indicators
Zeitsperre Aug 9, 2022
8c3449d
fix FWI title
Zeitsperre Aug 9, 2022
547977a
fix failing test and update test failure message
Zeitsperre Aug 9, 2022
6ee7682
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 11, 2022
f0cca55
synchronize temperature indicators, part 1
Zeitsperre Aug 11, 2022
6fe2ed9
basic temperature indicators and daily temperature range
Zeitsperre Aug 12, 2022
582e72c
fix formatting errors
Zeitsperre Aug 12, 2022
834d906
fix heat wave index thresh reference
Zeitsperre Aug 12, 2022
31f26ba
typo fixes
Zeitsperre Aug 12, 2022
290a0af
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 17, 2022
3125450
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 17, 2022
3e8b76c
synchronize temperature indicators, part 2
Zeitsperre Aug 17, 2022
4e6c9f9
synchronize temperature indicators, part 3
Zeitsperre Aug 18, 2022
fa6d22a
add a relevant reference
Zeitsperre Aug 18, 2022
88a3f12
Adjust tests for new indicator descriptions
Zeitsperre Aug 18, 2022
6af62f7
Add missing indicator formatter params, correct "unkown" to "unknown"
Zeitsperre Aug 18, 2022
2654631
fix test that used unkown
Zeitsperre Aug 18, 2022
e4178ae
update HISTORY.rst
Zeitsperre Aug 19, 2022
9e43984
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 19, 2022
f499d53
Apply suggestions from code review
Zeitsperre Aug 22, 2022
0fe28c0
Update xclim/data/fr.json
Zeitsperre Aug 22, 2022
4e72097
Address comments from @dompaq
Zeitsperre Aug 22, 2022
64c0ea8
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 22, 2022
092a44d
Apply suggestions from code review
Zeitsperre Aug 22, 2022
dd62c25
temperatures should be singular
Zeitsperre Aug 24, 2022
3db4224
calendar date
Zeitsperre Aug 24, 2022
a64e736
typo fix
Zeitsperre Aug 24, 2022
7c5874a
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 24, 2022
018618a
Apply suggestions from code review
Zeitsperre Aug 24, 2022
5bd03d0
Apply suggestions from code review
Zeitsperre Aug 24, 2022
721b807
fix GROWING_SEASON_END description, missing accents and punctuation, …
Zeitsperre Aug 24, 2022
d11ad68
réfrigérés -> climatisés
Zeitsperre Aug 24, 2022
9ad3dff
Update xclim/data/fr.json
Zeitsperre Aug 24, 2022
6464d59
CONSECUTIVE_FROST_DAYS fixes, add croissance to EFFECTIVE_GROWING_DEG…
Zeitsperre Aug 24, 2022
9632bff
Update xclim/data/fr.json
Zeitsperre Aug 24, 2022
1fc05da
Apply suggestions from code review
Zeitsperre Aug 24, 2022
c7887b6
Update xclim/data/fr.json
Zeitsperre Aug 24, 2022
ffa7095
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 24, 2022
bce98fb
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 29, 2022
f89e14a
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 30, 2022
ee0a61a
Addressed French indicator translation comments
Zeitsperre Aug 30, 2022
4dcc370
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 30, 2022
25c351d
fix test
Zeitsperre Aug 30, 2022
cab1692
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 30, 2022
8ebcd9a
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Aug 30, 2022
2fb1b46
Remove deprecated types import
Zeitsperre Aug 31, 2022
ddefbc4
Address first round of comments from EmilieBresson
Zeitsperre Aug 31, 2022
16d6554
fix {freq} typos
Zeitsperre Aug 31, 2022
7a15f2f
Comments addressed, some English metadata adjustments, some notes add…
Zeitsperre Aug 31, 2022
7f66ac1
add warning to last_spring_frost about default options
Zeitsperre Aug 31, 2022
86e224a
mark parameters for many indicators as default (parametrizable)
Zeitsperre Aug 31, 2022
c4c7a98
2nd round of comments from EmilieBresson
Zeitsperre Aug 31, 2022
0da0f57
fix wrong parameter passed to indicator
Zeitsperre Aug 31, 2022
f3c1ec8
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Sep 1, 2022
741db93
address comments relevant to snow indices, given thresholds
Zeitsperre Sep 1, 2022
6c3a284
fix growing season indices docstring and metadata, numpy docstring de…
Zeitsperre Sep 1, 2022
c9e42cc
Apply suggestions from code review
tlogan2000 Sep 1, 2022
ccf13fa
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Sep 6, 2022
865e231
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Sep 6, 2022
ce91b30
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Sep 7, 2022
2465006
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Sep 12, 2022
2119a32
Address comments received through personal communication
Zeitsperre Sep 12, 2022
fd640a6
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Sep 15, 2022
cea4594
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Sep 30, 2022
e3ecd7a
oops
Zeitsperre Sep 30, 2022
35bae40
add huglin index translation, minor typo fixes
Zeitsperre Oct 3, 2022
d3dcd07
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Oct 4, 2022
39046db
fix freezethaw indicator metadata and translations
Zeitsperre Oct 5, 2022
eaacaaa
Address review comments and fix typos
Zeitsperre Oct 5, 2022
f714178
Address final review comments
Zeitsperre Oct 6, 2022
0490ad2
Adjust freezethaw spell expected descriptions, adjust test structure
Zeitsperre Oct 6, 2022
8fe3d8b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 6, 2022
a9f2c54
typo fix
Zeitsperre Oct 6, 2022
6139ab6
Apply suggestions from code review
Zeitsperre Oct 6, 2022
20106ac
d' -> des
Zeitsperre Oct 6, 2022
575ebc2
deprecate freshet_start indice, wrap freshet_start indicator using fi…
Zeitsperre Oct 7, 2022
eae8e5b
Integrate operators into hot_spell_max_length, hot_spell_frequency, c…
Zeitsperre Oct 7, 2022
80f5249
typo fixes
Zeitsperre Oct 7, 2022
2a121ea
update HISTORY.rst
Zeitsperre Oct 7, 2022
3d032a0
revert unnecessary default parameters
Zeitsperre Oct 7, 2022
7f0fdc9
update HISTORY.rst
Zeitsperre Oct 7, 2022
8f7756a
update tests
Zeitsperre Oct 7, 2022
0639563
Deprecate `freshet_start` indice (#1196)
Zeitsperre Oct 7, 2022
32647b9
Merge branch 'french_metadata_overhaul' into fix_1194
Zeitsperre Oct 7, 2022
8995ba2
Adopt operators in warm/cold spell, dry, and wet days indices (#1197)
Zeitsperre Oct 7, 2022
deced3a
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Oct 13, 2022
b093a97
remove now-unnecessary fields from params_formatter
Zeitsperre Oct 13, 2022
2b34625
synchronize csdi and wsdi
Zeitsperre Oct 13, 2022
67f0d47
conversion with long_name keys
Zeitsperre Oct 24, 2022
3ec2d5f
rainfrzgr with long_name keys
Zeitsperre Oct 24, 2022
3ff9c93
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Oct 25, 2022
865104a
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Oct 25, 2022
b27808e
precipitation indicators with long_name keys
Zeitsperre Oct 28, 2022
4c4000e
wind indicators with long_name keys
Zeitsperre Oct 28, 2022
5ae4117
sea_ice indicators with long_name keys
Zeitsperre Oct 28, 2022
b3c934d
streamflow indicators with long_name keys
Zeitsperre Oct 28, 2022
b6e0031
temperature indicators with long_name keys - part 1
Zeitsperre Oct 28, 2022
199e53a
temperature indicators with long_name keys - part 2
Zeitsperre Oct 28, 2022
271aa81
field order, minor typos, degree-days indicators
Zeitsperre Oct 31, 2022
f614ac2
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Oct 31, 2022
86cd62e
docstring consistency
Zeitsperre Oct 31, 2022
9dd6930
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Oct 31, 2022
87320ff
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Oct 31, 2022
44bcc1d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2022
646ef24
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Oct 31, 2022
6b31e42
wsdi
Zeitsperre Oct 31, 2022
c091768
agroclimate indices
Zeitsperre Oct 31, 2022
5ffaad4
fix tests
Zeitsperre Oct 31, 2022
3a982e2
more test fixes
Zeitsperre Oct 31, 2022
9600901
fix heat_wave_index docstring, fix after_date values
Zeitsperre Oct 31, 2022
8dc59df
Merge branch 'master' into french_metadata_overhaul
Zeitsperre Nov 1, 2022
a60c7f1
temporarily disable dded
Zeitsperre Nov 1, 2022
71945c3
fix bad kwarg
Zeitsperre Nov 1, 2022
407ab12
Revert "temporarily disable dded"
Zeitsperre Nov 1, 2022
af1ae71
remove lambda from long_name
Zeitsperre Nov 1, 2022
a17413a
more accurate HISTORY.rst
Zeitsperre Nov 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ New features and enhancements
Breaking changes
^^^^^^^^^^^^^^^^
* `scipy` has been temporarily pinned below version 1.9 until lmoments3 tests can be rewritten to account for the new API. (:issue:`1142`, :pull:`1143`).
* English indicator metadata has been adjusted to remove frequencies and other variable-sourced fields in the `long_name` of indicators. English indicators now have an explicit `title` and `abstract`. (:issue:`936`, :pull:`1123`).
* French indicator metadata translations are now more uniform and follow agreed-upon grammar conventions, removing variable-sourced fields in `long_name_fr`. (:issue:`936`, :pull:`1123`).

Bug fixes
^^^^^^^^^
* Fixed ``saturation_vapor_pressure`` for temperatures in other units than Kelvins (also fixes ``relative_humidity_from_dewpoint``). (:issue:`1125`, :pull:`1127`).
* Indicators that do not care about the input frequency of the data will not check the cell methods of their inputs. (:pull:`1128`).
* Fixed the signature and docstring of ``heat_index`` by changing ``tasmax`` to ``tas``. (:issue:`1126`, :pull:`1128`).
* Fixed a formatting issue with virtual indicator modules (`_gen_returns_section`) that was creating malformed `Returns` sections in `sphinx`-generated documentation. (:pull:`1131`).
* Removed some artefact reference roles introduced in :pull:`1131` that were causing LaTeX builds of the documentation to fail. (:issue:`1154`, :pull:`1156`).
* Fixed a formatting issue with virtual indicator modules (`_gen_returns_section`) that was creating malformed `Returns` sections in `sphinx`-generated documentation. (:pull:`1131`).

Internal changes
^^^^^^^^^^^^^^^^
Expand Down
35 changes: 20 additions & 15 deletions xclim/core/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@
from xclim.core.utils import InputKind, PercentileDataArray

DEFAULT_FORMAT_PARAMS = {
"tasmin_per_thresh": "{unkown}",
"tasmin_per_window": "{unkown}",
"tasmin_per_period": "{unkown}",
"tas_per_thresh": "{unkown}",
"tas_per_window": "{unkown}",
"tas_per_period": "{unkown}",
"tasmax_per_thresh": "{unkown}",
"tasmax_per_window": "{unkown}",
"tasmax_per_period": "{unkown}",
"pr_per_thresh": "{unkown}",
"pr_per_window": "{unkown}",
"pr_per_period": "{unkown}",
"tasmin_per_thresh": "{unknown}",
"tasmin_per_window": "{unknown}",
"tasmin_per_period": "{unknown}",
"tas_per_thresh": "{unknown}",
"tas_per_window": "{unknown}",
"tas_per_period": "{unknown}",
"tasmax_per_thresh": "{unknown}",
"tasmax_per_window": "{unknown}",
"tasmax_per_period": "{unknown}",
"pr_per_thresh": "{unknown}",
"pr_per_window": "{unknown}",
"pr_per_period": "{unknown}",
# FIXME: The following params can be found in indices._multivariate
"tasmax_per": "{unknown}",
"tasmin_per": "{unknown}",
"tas_per": "{unknown}",
"pr_per": "{unknown}",
Zeitsperre marked this conversation as resolved.
Show resolved Hide resolved
}


Expand All @@ -53,7 +58,8 @@ def __init__(
mapping : Mapping[str, Sequence[str]]
A mapping from values to their possible variations.
modifiers : Sequence[str]
The list of modifiers, must be the as long as the longest value of `mapping`. Cannot include reserved modifier 'r'.
The list of modifiers, must be the as long as the longest value of `mapping`.
Cannot include reserved modifier 'r'.
"""
super().__init__()
if "r" in modifiers:
Expand Down Expand Up @@ -427,8 +433,7 @@ def _call_and_add_history(*args, **kwargs):
def gen_call_string(funcname: str, *args, **kwargs):
"""Generate a signature string for use in the history attribute.

DataArrays and Dataset are replaced with their name, while Nones, floats,
ints and strings are printed directly.
DataArrays and Dataset are replaced with their name, while Nones, floats, ints and strings are printed directly.
All other objects have their type printed between < >.

Arguments given through positional arguments are printed positionnally and those
Expand Down
569 changes: 284 additions & 285 deletions xclim/data/fr.json

Large diffs are not rendered by default.

Loading