diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b197b58e80..d9ebbbae01 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -6,6 +6,12 @@ on: schedule: # Runs every day at 23:00. - cron: "0 23 * * *" + workflow_dispatch: + inputs: + first_commit: + description: "Argument to be passed to the overnight benchmark script." + required: false + type: string jobs: benchmark: @@ -64,7 +70,12 @@ jobs: - name: Run overnight benchmarks run: | - first_commit=$(git log --after="$(date -d "1 day ago" +"%Y-%m-%d") 23:00:00" --pretty=format:"%h" | tail -n 1) + first_commit=${{ inputs.first_commit }} + if [ "$first_commit" != "" ] + then + first_commit=$(git log --after="$(date -d "1 day ago" +"%Y-%m-%d") 23:00:00" --pretty=format:"%h" | tail -n 1) + fi + if [ "$first_commit" != "" ] then nox --session="benchmarks(overnight)" -- $first_commit diff --git a/benchmarks/benchmarks/generate_data/__init__.py b/benchmarks/benchmarks/generate_data/__init__.py index 78b971d9de..52a5aceca8 100644 --- a/benchmarks/benchmarks/generate_data/__init__.py +++ b/benchmarks/benchmarks/generate_data/__init__.py @@ -113,7 +113,7 @@ def load_realised(): file loading, but some benchmarks are only meaningful if starting with real arrays. """ - from iris.fileformats.netcdf import _get_cf_var_data as pre_patched + from iris.fileformats.netcdf.loader import _get_cf_var_data as pre_patched def patched(cf_var, filename): return as_concrete_data(pre_patched(cf_var, filename))