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

Fix benchmarks netcdf import #5001

Merged
merged 2 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarks/generate_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down