File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 35
35
- repo : https://github.com/astral-sh/ruff-pre-commit
36
36
rev : " v0.12.2"
37
37
hooks :
38
- - id : ruff
38
+ - id : ruff-check
39
39
args : [--fix]
40
40
- id : ruff-format
41
41
- repo : https://github.com/pre-commit/mirrors-mypy
Original file line number Diff line number Diff line change 9
9
from typing import TYPE_CHECKING , Any
10
10
11
11
from esmvalcore .cmor .table import _CMOR_KEYS , _update_cmor_facets
12
- from esmvalcore .dataset import Dataset , _isglob
12
+ from esmvalcore .dataset import INHERITED_FACETS , Dataset , _isglob
13
13
from esmvalcore .esgf .facets import FACETS
14
14
from esmvalcore .exceptions import RecipeError
15
15
from esmvalcore .local import LocalFile , _replace_years_with_timerange
@@ -249,7 +249,7 @@ def _append_missing_supplementaries(
249
249
supplementary_facets : Facets = {
250
250
facet : "*"
251
251
for facet in FACETS .get (project , ["mip" ])
252
- if facet not in _CMOR_KEYS
252
+ if facet not in _CMOR_KEYS + tuple ( INHERITED_FACETS )
253
253
}
254
254
if "version" in facets :
255
255
supplementary_facets ["version" ] = "*"
Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ def test_merge_supplementaries_combine_dataset_with_variable(session):
253
253
assert len (datasets ) == 1
254
254
assert len (datasets [0 ].supplementaries ) == 2
255
255
assert datasets [0 ].supplementaries [0 ].facets ["short_name" ] == "areacella"
256
+ assert datasets [0 ].supplementaries [0 ].facets ["dataset" ] == "AWI-ESM-1-1-LR"
256
257
assert datasets [0 ].supplementaries [1 ].facets ["short_name" ] == "sftlf"
257
258
258
259
@@ -404,9 +405,12 @@ def test_append_missing_supplementaries():
404
405
facets ,
405
406
settings ,
406
407
)
407
-
408
408
short_names = {f ["short_name" ] for f in supplementaries }
409
409
assert short_names == {"areacella" , "sftlf" }
410
+ sftlf = supplementaries [1 ]
411
+ assert (
412
+ "dataset" not in sftlf
413
+ ) # dataset will be inherited from the main variable
410
414
411
415
412
416
def test_report_unexpanded_globs (mocker ):
You can’t perform that action at this time.
0 commit comments