Skip to content

Commit 4f3a737

Browse files
Updating feature branch unstructured_scheme from e528cbf to head of main, b32e134
2 parents b32e134 + 52aeef1 commit 4f3a737

33 files changed

+3165
-498
lines changed

.cirrus.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
SKIP_TEST_TASK: ""
2121
SKIP_BENCHMARK_TASK: ""
2222
# Maximum cache period (in weeks) before forcing a new cache upload.
23-
CACHE_PERIOD: "2"
23+
CACHE_PERIOD: "0"
2424
# Increment the build number to force new conda cache upload.
2525
CONDA_CACHE_BUILD: "0"
2626
# Increment the build number to force new nox cache upload.
@@ -31,6 +31,27 @@ env:
3131
PIP_CACHE_PACKAGES: "pip setuptools wheel nox pyyaml"
3232
# Conda packages to be installed.
3333
CONDA_CACHE_PACKAGES: "nox pip pyyaml"
34+
# Use specific custom iris source feature branch.
35+
IRIS_SOURCE: "github:main"
36+
# Git commit hash for iris test data.
37+
IRIS_TEST_DATA_VERSION: "2.2"
38+
# Base directory for the iris-test-data.
39+
IRIS_TEST_DATA_DIR: ${HOME}/iris-test-data
40+
OVERRIDE_TEST_DATA_REPOSITORY: ${IRIS_TEST_DATA_DIR}/test_data
41+
42+
43+
#
44+
# YAML alias for the iris-test-data cache.
45+
#
46+
iris_test_data_template: &IRIS_TEST_DATA_TEMPLATE
47+
data_cache:
48+
folder: ${IRIS_TEST_DATA_DIR}
49+
fingerprint_script:
50+
- echo "iris-test-data v${IRIS_TEST_DATA_VERSION}"
51+
populate_script:
52+
- wget --quiet https://github.com/SciTools/iris-test-data/archive/v${IRIS_TEST_DATA_VERSION}.zip -O iris-test-data.zip
53+
- unzip -q iris-test-data.zip
54+
- mv iris-test-data-${IRIS_TEST_DATA_VERSION} ${IRIS_TEST_DATA_DIR}
3455

3556

3657
#
@@ -88,10 +109,6 @@ test_task:
88109
only_if: ${SKIP_TEST_TASK} == ""
89110
auto_cancellation: true
90111
matrix:
91-
env:
92-
PY_VER: "3.6"
93-
env:
94-
PY_VER: "3.7"
95112
env:
96113
PY_VER: "3.8"
97114
COVERAGE: "true"
@@ -104,6 +121,7 @@ test_task:
104121
- echo "${CIRRUS_TASK_NAME}"
105122
- echo "${NOX_CACHE_BUILD}"
106123
- if [ -n "${IRIS_SOURCE}" ]; then echo "${IRIS_SOURCE}"; fi
124+
<< : *IRIS_TEST_DATA_TEMPLATE
107125
test_script:
108126
- export CONDA_OVERRIDE_LINUX="$(uname -r | cut -d'+' -f1)"
109127
- nox --session tests -- --verbose

benchmarks/benchmarks/__init__.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
11
"""Benchmark tests for iris-esmf-regrid"""
2+
3+
4+
def disable_repeat_between_setup(benchmark_object):
5+
"""
6+
Decorator for benchmarks where object persistence would be inappropriate.
7+
8+
E.g:
9+
* Data is realised during testing.
10+
11+
Can be applied to benchmark classes/methods/functions.
12+
13+
https://asv.readthedocs.io/en/stable/benchmarks.html#timing-benchmarks
14+
15+
"""
16+
# Prevent repeat runs between setup() runs - object(s) will persist after 1st.
17+
benchmark_object.number = 1
18+
# Compensate for reduced certainty by increasing number of repeats.
19+
# (setup() is run between each repeat).
20+
# Minimum 5 repeats, run up to 30 repeats / 20 secs whichever comes first.
21+
benchmark_object.repeat = (5, 30, 20.0)
22+
# ASV uses warmup to estimate benchmark time before planning the real run.
23+
# Prevent this, since object(s) will persist after first warmup run,
24+
# which would give ASV misleading info (warmups ignore ``number``).
25+
benchmark_object.warmup_time = 0.0
26+
27+
return benchmark_object
28+
29+
30+
def skip_benchmark(benchmark_object):
31+
"""
32+
Decorator for benchmarks skipping benchmarks.
33+
"""
34+
35+
def setup_cache(self):
36+
pass
37+
38+
def setup(*args):
39+
raise NotImplementedError
40+
41+
benchmark_object.setup_cache = setup_cache
42+
benchmark_object.setup = setup
43+
44+
return benchmark_object

0 commit comments

Comments
 (0)