Skip to content

Commit

Permalink
Merge branch 'main' into boundless_coords
Browse files Browse the repository at this point in the history
* main: (29 commits)
  Bump scitools/workflows from 2024.01.0 to 2024.04.3 (SciTools#356)
  Bump peter-evans/create-pull-request from 5.0.2 to 6.0.5 (SciTools#355)
  [pre-commit.ci] pre-commit autoupdate (SciTools#336)
  Updated environment lockfiles (SciTools#344)
  Update lockfiles and fix for new esmpy (SciTools#342)
  Fix for esmpy (SciTools#353)
  Fix usage of map_blocks (SciTools#338)
  Revert "Updated environment lockfiles (SciTools#335)" (SciTools#341)
  Updated environment lockfiles (SciTools#335)
  Bump actions/cache from 3 to 4 (SciTools#333)
  Bump actions/upload-artifact from 3 to 4 (SciTools#324)
  Bump actions/stale from 8.0.0 to 9.0.0 (SciTools#322)
  fix asv (SciTools#339)
  [pre-commit.ci] pre-commit autoupdate (SciTools#330)
  Bump scitools/workflows from 2023.09.0 to 2024.01.0 (SciTools#334)
  Updated environment lockfiles (SciTools#327)
  [pre-commit.ci] pre-commit autoupdate (SciTools#328)
  Updated environment lockfiles (SciTools#304)
  Add CITATION.cff (SciTools#319)
  updated for enums (SciTools#293)
  ...

# Conflicts:
#	esmf_regrid/schemes.py
  • Loading branch information
stephenworsley committed May 2, 2024
2 parents a48b9a0 + fa3541b commit dd2a8da
Show file tree
Hide file tree
Showing 48 changed files with 1,767 additions and 962 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

steps:
- name: "checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -62,7 +62,7 @@ jobs:
pip install asv nox
- name: Cache environment directories
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
.nox
Expand All @@ -78,7 +78,7 @@ jobs:
nox --session="benchmarks(branch)" -- "${COMPARE}"
- name: Archive ASV results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: asv-report
path: |
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/ci-citation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ci-citation

on:
pull_request:
paths:
- "CITATION.cff"

push:
paths:
- "CITATION.cff"

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
validate:
name: "validate"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "check CITATION.cff"
uses: citation-file-format/[email protected]
with:
args: "--validate"
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@2023.05.0
uses: scitools/workflows/.github/workflows/ci-manifest.yml@2024.04.3
16 changes: 11 additions & 5 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]
include:
- python-version: "3.10"
- python-version: "3.11"
coverage: true

steps:
- name: "checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Nox
run: |
pip install nox
- name: Cache environment directories
id: cache-env-dir
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
.nox
Expand All @@ -72,7 +72,7 @@ jobs:

- name: Cache test data directory
id: cache-test-data
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ env.IRIS_TEST_DATA_PATH }}
Expand All @@ -97,3 +97,9 @@ jobs:
COVERAGE: ${{ matrix.coverage }}
run: |
nox --session tests -- --verbose
- name: Upload coverage report
uses: codecov/codecov-action@v4
if: ${{ matrix.coverage }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
18 changes: 9 additions & 9 deletions .github/workflows/ci-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -46,7 +46,7 @@ jobs:
run: |
ls -l ${{ github.workspace }}/dist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
Expand All @@ -67,16 +67,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.10", "3.11", "3.12"]
session: ["wheel"]

steps:
- name: "checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
Expand All @@ -87,7 +87,7 @@ jobs:
- name: Cache environment directories
id: cache-env-dir
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
.nox
Expand All @@ -105,7 +105,7 @@ jobs:
name: "show artifacts"
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
Expand All @@ -122,7 +122,7 @@ jobs:
# and check for the SciTools repo
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'SciTools-incubator'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
Expand All @@ -142,7 +142,7 @@ jobs:
# upload to PyPI for every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && github.repository_owner == 'SciTools-incubator'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/refresh-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
gen_lockfiles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install nox
run: |
source $CONDA/bin/activate base
conda install -y -c conda-forge nox pyyaml
- name: generate lockfiles
run: $CONDA/bin/nox --session update_lockfiles
- name: create pull request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e
with:
commit-message: Updated environment lockfiles
delete-branch: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v8.0.0
- uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: '@SciTools-incubator/esmf-regrid-devs This issue is stale due to a lack of activity in the last 180 days. Remove stale label or comment, otherwise this issue will close automatically in 14 days time.'
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.4.0'
rev: 'v4.6.0'
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
Expand All @@ -17,14 +17,14 @@ repos:
# Don't commit to master branch.
- id: no-commit-to-branch
- repo: https://github.com/psf/black
rev: '23.7.0'
rev: '24.4.2'
hooks:
- id: black
# Force black to run on whole repo, using settings from pyproject.toml
pass_filenames: false
args: [--config=./pyproject.toml, .]
- repo: https://github.com/PyCQA/flake8
rev: '6.0.0'
rev: '7.0.0'
hooks:
# Run flake8.
- id: flake8
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ 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/).

## [Unreleased]
## [0.9] - 2023-11-03

### Added

- [PR#178](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/178)
Added support for coordinate systems with non-degree type units.
[@stephenworsley](https://github.com/stephenworsley)

- [PR#311](https://github.com/SciTools-incubator/iris-esmf-regrid/pull/311)
Added support for Mesh to Mesh regridding.
[@HGWright](https://github.com/HGWright)

### Added

Expand Down
12 changes: 12 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Worsley"
given-names: "Stephen"
orcid: "https://orcid.org/0009-0008-1704-8445"
title: "iris-esmf-regrid"
abstract: "A collection of structured and unstructured ESMF regridding schemes for Iris"
repository-code: "https://github.com/SciTools-incubator/iris-esmf-regrid"
license: "BSD-3-Clause"
license-url: "https://spdx.org/licenses/BSD-3-Clause.html"
type: "software"
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ exclude .gitignore
exclude .pre-commit-config.yaml
exclude .readthedocs.yml
include CHANGELOG.md
include CITATION.cff
prune benchmarks
exclude codecov.yml
prune docs
recursive-include esmf_regrid *.py *.txt
exclude noxfile.py
prune requirements
prune requirements
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://api.cirrus-ci.com/github/SciTools-incubator/iris-esmf-regrid.svg)](https://cirrus-ci.com/github/SciTools-incubator/iris-esmf-regrid)
[![Documentation Status](https://readthedocs.org/projects/iris-esmf-regrid/badge/?version=latest)](https://iris-esmf-regrid.readthedocs.io/en/latest/?badge=latest)
[![ci-citation](https://github.com/SciTools-incubator/iris-esmf-regrid/actions/workflows/ci-citation.yml/badge.svg)](https://github.com/SciTools-incubator/iris-esmf-regrid/actions/workflows/ci-citation.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/SciTools-incubator/iris-esmf-regrid/main.svg)](https://results.pre-commit.ci/latest/github/SciTools-incubator/iris-esmf-regrid/master)
[![codecov](https://codecov.io/gh/SciTools-incubator/iris-esmf-regrid/branch/main/graph/badge.svg?token=PKBXEHOZFT)](https://codecov.io/gh/SciTools-incubator/iris-esmf-regrid)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"environment_type": "conda-delegated",
"show_commit_url": "https://github.com/SciTools-incubator/iris-esmf-regrid/commit/",
"branches": ["upstream/main"],
"build_command": [
"python setup.py build",
"python -mpip wheel --no-deps -w {build_cache_dir} {build_dir}"
],

"benchmark_dir": "./benchmarks",
"env_dir": ".asv/env",
Expand Down
1 change: 1 addition & 0 deletions benchmarks/asv_delegated_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def _prep_env(self) -> None:
message = f"Running delegated environment management for: {self.name}"
log.info(message)
env_path = Path(self._path)
environ["ESMFMKFILE"] = str(env_path / "lib" / "esmf.mk")

def copy_asv_files(src_parent: Path, dst_parent: Path) -> None:
"""For copying between self._path and a temporary cache."""
Expand Down
1 change: 0 additions & 1 deletion benchmarks/benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Benchmark tests for iris-esmf-regrid."""


from os import environ


Expand Down
7 changes: 7 additions & 0 deletions benchmarks/benchmarks/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
benchmark sequence runs over two different Python versions.
"""

from inspect import getsource
from os import environ
from pathlib import Path
import re
from subprocess import CalledProcessError, check_output, run
import sys
from textwrap import dedent
from warnings import warn

Expand Down Expand Up @@ -55,6 +57,8 @@
# False forces a benchmark run to re-make all the data files.
REUSE_DATA = True

ESMFMKFILE = "ESMFMKFILE"


def run_function_elsewhere(func_to_run, *args, **kwargs):
"""
Expand Down Expand Up @@ -90,9 +94,12 @@ def run_function_elsewhere(func_to_run, *args, **kwargs):
f"{func_to_run.__name__}(" + ",".join(func_call_term_strings) + ")"
)
python_string = "\n".join([func_string, func_call_string])
old_esmf_mk_file = environ.get(ESMFMKFILE, None)
environ[ESMFMKFILE] = str(Path(sys.executable).parents[1] / "lib" / "esmf.mk")
result = run(
[DATA_GEN_PYTHON, "-c", python_string], capture_output=True, check=True
)
environ[ESMFMKFILE] = old_esmf_mk_file
return result.stdout


Expand Down
4 changes: 3 additions & 1 deletion esmf_regrid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
except ImportError:
raise exc

# constants needs to be above schemes, as it is used within
from .constants import Constants, check_method, check_norm
from .schemes import *


__version__ = "0.9.dev0"
__version__ = "0.10.dev0"
Loading

0 comments on commit dd2a8da

Please sign in to comment.