Skip to content
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e019ab5
added custom CMOR tables for ESACCI-PERMAFROST
axel-lauer Feb 28, 2024
fbce425
added new coordinate to custom coordinate table
axel-lauer Feb 28, 2024
cc102fa
changed sdepth to depth
axel-lauer Mar 4, 2024
c38bda3
Merge branch 'main' into esacci-permafrost
axel-lauer Jun 12, 2024
659494d
added derivation script for permafrost extent (pfr)
axel-lauer Jun 14, 2024
b4f46b9
permafrost extent: switched from sftgif to mrsos
axel-lauer Jun 17, 2024
0c86835
Merge branch 'main' into esacci-permafrost
axel-lauer Jul 23, 2025
4db4a42
updated pfr.py
axel-lauer Jul 23, 2025
9ee7825
Update esmvalcore/preprocessor/_derive/pfr.py
axel-lauer Dec 19, 2025
480d33d
fix ruff issues
axel-lauer Dec 19, 2025
26c19da
update pfr.py
axel-lauer Dec 19, 2025
e562830
removed comments
axel-lauer Dec 19, 2025
f4fb071
Merge branch 'main' into esacci-permafrost
axel-lauer Dec 19, 2025
b616d92
non-working draft of pfr derivation unit test
axel-lauer Dec 19, 2025
8a92845
added test for derived variable pfr
axel-lauer Jan 9, 2026
1db80de
pre-commit results
axel-lauer Jan 9, 2026
5d0f518
Update esmvalcore/preprocessor/_derive/pfr.py
axel-lauer Jan 13, 2026
66eb70a
Merge branch 'main' into esacci-permafrost
axel-lauer Jan 13, 2026
b3d0fca
extended unit test for derivation of pfr
axel-lauer Jan 13, 2026
3177cd8
Merge branch 'esacci-permafrost' of github.com:ESMValGroup/ESMValCore…
axel-lauer Jan 13, 2026
d370a3b
update test_pfr.py
axel-lauer Jan 13, 2026
01c8227
Update esmvalcore/preprocessor/_derive/pfr.py
axel-lauer Jan 15, 2026
cce9088
Update esmvalcore/preprocessor/_derive/pfr.py
axel-lauer Jan 15, 2026
59bc9c0
Update esmvalcore/preprocessor/_derive/pfr.py
axel-lauer Jan 15, 2026
ee34de9
split unit tests into separate functions
axel-lauer Jan 15, 2026
f20e3d7
updated pfr
axel-lauer Jan 15, 2026
c5453bb
Merge branch 'main' into esacci-permafrost
axel-lauer Jan 15, 2026
6913302
Update esmvalcore/preprocessor/_derive/pfr.py
axel-lauer Jan 22, 2026
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
Prev Previous commit
Next Next commit
pre-commit results
  • Loading branch information
axel-lauer committed Jan 9, 2026
commit 1db80debeb4f8e1e39c7b6ab03d0bf713a5b24fc
42 changes: 32 additions & 10 deletions tests/unit/preprocessor/_derive/test_pfr.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
"""Test derivation of ``pfr``."""

import cf_units
import iris
import numpy as np
import pytest
import cf_units

from esmvalcore.preprocessor._derive import pfr


@pytest.fixture
def cubes():
time_coord = iris.coords.DimCoord(
[0.0, 31.0, 59.0, 90.0, 120.0, 151.0, 181.0, 212.0, 243.0, 273.0,
304.0, 334.0, 365.0, 396.0, 424.0, 455.0, 485.0, 516.0, 546.0,
577.0, 608.0, 638.0, 669.0, 699.0],
[
0.0,
31.0,
59.0,
90.0,
120.0,
151.0,
181.0,
212.0,
243.0,
273.0,
304.0,
334.0,
365.0,
396.0,
424.0,
455.0,
485.0,
516.0,
546.0,
577.0,
608.0,
638.0,
669.0,
699.0,
],
standard_name="time",
var_name="time",
units="days since 1950-01-01 00:00:00",
Expand Down Expand Up @@ -42,7 +65,7 @@ def cubes():
(dpth_coord, 1),
(lat_coord, 2),
(lon_coord, 3),
]
]
tsl_data = np.zeros(shape=(24, 3, 2, 2))
tsl_data[:, 0, :, :] = 280.0
tsl_data[:, 1, :, :] = 270.0
Expand All @@ -58,9 +81,9 @@ def cubes():
(time_coord, 0),
(lat_coord, 1),
(lon_coord, 2),
]
]
mrsos_data = np.zeros(shape=(24, 2, 2))
mrsos_data[:, :, :] = 10.0
mrsos_data[:, :, :] = 10.0
mrsos_cube = iris.cube.Cube(
mrsos_data,
dim_coords_and_dims=coord_specs,
Expand All @@ -71,10 +94,9 @@ def cubes():
coord_specs = [
(lat_coord, 0),
(lon_coord, 1),
]
]
sftlf_data = np.zeros(shape=(2, 2))
sftlf_data[:, :] = 100.0

sftlf_cube = iris.cube.Cube(
sftlf_data,
dim_coords_and_dims=coord_specs,
Expand Down Expand Up @@ -105,4 +127,4 @@ def test_pfr_required():
{"short_name": "tsl", "mip": "Lmon"},
{"short_name": "sftlf", "mip": "fx"},
{"short_name": "mrsos", "mip": "Lmon"},
]
]