Skip to content

Commit

Permalink
Merge branch 'main' into boundless_coords
Browse files Browse the repository at this point in the history
* main:
  Bump scitools/workflows from 2024.06.0 to 2024.06.5 (SciTools#377)
  Fix typo (SciTools#371)
  Bump scitools/workflows from 2024.04.3 to 2024.06.0 (SciTools#365)
  Update to v0.11.dev0. (SciTools#363)
  Update to v0.10.0 (SciTools#362)
  Extend regridder saving/loading to all regridders (SciTools#357)
  Ensure dtype is preserved after regridding (SciTools#239)
  Move benchmark code from nox to bm_runner (SciTools#361)

# Conflicts:
#	esmf_regrid/schemes.py
  • Loading branch information
stephenworsley committed Jul 18, 2024
2 parents c9498ea + 1772591 commit 1c12a90
Show file tree
Hide file tree
Showing 25 changed files with 1,036 additions and 283 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ exclude =
build
esmf_regrid/__init__.py
esmf_regrid/tests/results
benchmarks/*
4 changes: 1 addition & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ jobs:
- name: Benchmark script
run: |
if ${{ github.event_name != 'pull_request' }}; then export COMPARE="HEAD~"; else export COMPARE="origin/${{ github.base_ref }}"; fi;
nox --session=tests --install-only
export DATA_GEN_PYTHON=$(realpath $(find .nox -path "*tests/bin/python"))
nox --session="benchmarks(branch)" -- "${COMPARE}"
python benchmarks/bm_runner.py branch ${COMPARE}
- name: Archive ASV results
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ concurrency:
jobs:
manifest:
name: "check-manifest"
uses: scitools/workflows/.github/workflows/ci-manifest.yml@2024.04.3
uses: scitools/workflows/.github/workflows/ci-manifest.yml@2024.06.5
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,40 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.10] - 2024-05-31

### Added

- [PR#357](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/357)
Added support for saving and loading of `ESMFAreaWeighted`, `ESMFBilinear`
and `ESMFNearest` regridders.
[@stephenworsley](https://github.com/stephenworsley)
- [PR#319](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/319)
Added `CITATION.cff`.
[@bjlittle](https://github.com/bjlittle)

### Changed

- [PR#361](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/361)
Moved the code for running benchmarks to `bm_runner.py` in line with iris
benchmarks.
[@stephenworsley](https://github.com/stephenworsley)
- [PR#293](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/293)
Enumerated method and normtype input.
[@ESadek-MO](https://github.com/ESadek-MO)

### Fixed

- [PR#239](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/239)
Ensured dtype is preserved by regridding.
[@stephenworsley](https://github.com/stephenworsley)
- [PR#353](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/353)
Fixed a bug which caused errors with ESMF versions 8.6 and higher.
[@stephenworsley](https://github.com/stephenworsley)
- [PR#338](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/338)
Fixed a potential memory leak when creating regridders.
[@stephenworsley](https://github.com/stephenworsley)

## [0.9] - 2023-11-03

### Added
Expand Down
23 changes: 17 additions & 6 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,27 @@ raising a ❌ failure.
installed, as well as Nox (see
[Benchmark environments](#benchmark-environments)).

[iris-esmf-regrid's noxfile](../noxfile.py) includes a `benchmarks` session
that provides conveniences for setting up before benchmarking, and can also
replicate the CI run locally. See the session docstring for detail.
The benchmark runner ([bm_runner.py](./bm_runner.py)) provides conveniences for
common benchmark setup and run tasks, including replicating the automated
overnight run locally. See `python bm_runner.py --help` for detail.

A significant portion of benchmark run time is environment management. Run-time
can be reduced by placing the benchmark environment on the same file system as
your
[Conda package cache](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#specify-pkg-directories),
if it is not already. You can achieve this by either:

- Temporarily reconfiguring `delegated_env_commands` and `delegated_env_parent`
in [asv.conf.json](asv.conf.json) to reference a location on the same file
system as the Conda package cache.
- Moving your Iris repo to the same file system as the Conda package cache.

### Environment variables

* `DATA_GEN_PYTHON` - required - path to a Python executable that can be
used to generate benchmark test objects/files; see
[Data generation](#data-generation). The Nox session sets this automatically,
but will defer to any value already set in the shell.
[Data generation](#data-generation). The benchmark runner sets this
automatically, but will defer to any value already set in the shell.
* `BENCHMARK_DATA` - optional - path to a directory for benchmark synthetic
test data, which the benchmark scripts will create if it doesn't already
exist. Defaults to `<root>/benchmarks/.data/` if not set. Note that some of
Expand All @@ -34,7 +45,7 @@ plan accordingly.
* `ON_DEMAND_BENCHMARKS` - optional - when set (to any value): benchmarks
decorated with `@on_demand_benchmark` are included in the ASV run. Usually
coupled with the ASV `--bench` argument to only run the benchmark(s) of
interest. Is set during the Nox `sperf` session.
interest. Is set during the benchmark runner `sperf` sub-commands.

### Reducing run time

Expand Down
5 changes: 5 additions & 0 deletions benchmarks/asv_delegated_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ def copy_asv_files(src_parent: Path, dst_parent: Path) -> None:
# Record new environment information in properties.
self._update_info()

def _run_conda(self, args, env=None):
# TODO: remove after airspeed-velocity/asv#1397 is merged and released.
args = ["--yes" if arg == "--force" else arg for arg in args]
return super()._run_conda(args, env)

def checkout_project(self, repo: Repo, commit_hash: str) -> None:
"""Check out the working tree of the project at given commit hash."""
super().checkout_project(repo, commit_hash)
Expand Down
Loading

0 comments on commit 1c12a90

Please sign in to comment.