Skip to content

Commit 18b3648

Browse files
committed
Merge branch 'nexus-upd' of https://github.com/iiasa/message-ix-models into nexus-upd
2 parents 63aad7c + 50e97e6 commit 18b3648

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2581
-1812
lines changed

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
# Only update major versions
5+
ignore:
6+
- dependency-name: "*"
7+
update-types:
8+
- "version-update:semver-minor"
9+
- "version-update:semver-patch"
10+
# Below config mirrors the example at
11+
# https://github.com/dependabot/dependabot-core/blob/main/.github/dependabot.yml
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
day: "sunday"
16+
time: "16:00"
17+
groups:
18+
all-actions:
19+
patterns: [ "*" ]
20+
assignees:
21+
- "glatterf42"
22+
- "khaeru"
23+
labels:
24+
- "dependencies"
25+
reviewers:
26+
- "glatterf42"
27+
- "khaeru"

.github/workflows/pytest.yaml

Lines changed: 51 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Test
22

33
on:
4-
push:
5-
branches: [ main ]
64
pull_request:
75
branches: [ main , "migrate-*"]
86
schedule:
@@ -18,42 +16,65 @@ jobs:
1816
pytest:
1917
strategy:
2018
matrix:
21-
# One job per OS; latest python version testable on GitHub actions.
22-
# These should match the versions used in the "pytest" workflows of both
23-
# ixmp and message_ix.
24-
version:
25-
- { os: macos-latest, python: "3.11" }
26-
- { os: ubuntu-latest, python: "3.11" }
27-
- { os: windows-latest, python: "3.11" }
28-
# Versions of both ixmp and message_ix to use
19+
os:
20+
- macos-latest
21+
- ubuntu-latest
22+
- windows-latest
2923
upstream:
30-
- { version: v3.4.0, extra-deps: '"pandas<2.0"' } # Minimum version given in setup.cfg
31-
- { version: v3.5.0, extra-deps: '"pandas<2.0"' }
32-
- { version: v3.6.0, extra-deps: '"pandas<2.0"' }
33-
- { version: v3.7.0, extra-deps: "" } # Latest released version
34-
- { version: main, extra-deps: "" } # Development version
24+
# In each group:
25+
# - Versions of ixmp and message_ix to test.
26+
# - Latest supported Python version for those or other dependencies.
27+
# - Extra dependencies, in particular fixed/maximum versions to resolve conficts.
28+
# - dask[dataframe] >= 2024.3.0 requires dask-expr and in turn pandas >= 2.0.
29+
# https://github.com/iiasa/message-ix-models/pull/156#issuecomment-2020152360
30+
# - genno: upstream versions < 3.8.0 import genno.computations, removed in 1.25.0.
31+
# https://github.com/iiasa/message-ix-models/pull/156
32+
# - pytest: upstream versions < 3.9.0 use a hook argument removed in pytest 8.1.0.
33+
# https://github.com/iiasa/message-ix-models/pull/155
34+
#
35+
# Minimum version given in pyproject.toml
36+
- version: v3.4.0
37+
python-version: "3.11"
38+
extra-deps: '"dask < 2024.3.0" "genno < 1.25" "pandas < 2.0" "pytest == 8.0.0"' #
39+
- version: v3.5.0
40+
python-version: "3.11"
41+
extra-deps: '"dask < 2024.3.0" "genno < 1.25" "pandas < 2.0" "pytest == 8.0.0"' #
42+
- version: v3.6.0
43+
python-version: "3.11"
44+
extra-deps: '"dask < 2024.3.0" "genno < 1.25" "pandas < 2.0" "pytest == 8.0.0"' #
45+
- version: v3.7.0
46+
python-version: "3.11"
47+
extra-deps: 'dask[dataframe] "genno < 1.25" "pytest == 8.0.0"' #
48+
# Latest released version
49+
- version: v3.8.0
50+
python-version: "3.12"
51+
extra-deps: 'dask[dataframe] "pytest == 8.0.0"' #
52+
# Development version
53+
- version: main
54+
python-version: "3.12"
55+
extra-deps: 'dask[dataframe]' #
3556

3657
fail-fast: false
3758

38-
runs-on: ${{ matrix.version.os }}
39-
name: ${{ matrix.version.os }}-py${{ matrix.version.python }}-upstream-${{ matrix.upstream.version }}
59+
runs-on: ${{ matrix.os }}
60+
name: ${{ matrix.os }}-py${{ matrix.upstream.python-version }}-upstream-${{ matrix.upstream.version }}
4061

4162
steps:
4263
- name: Cache test data
43-
uses: actions/cache@v3
64+
uses: actions/cache@v4
4465
with:
4566
path: message-local-data
46-
key: ${{ matrix.version.os }}
67+
key: ${{ matrix.os }}
4768

4869
- name: Check out message-ix-models
49-
uses: actions/checkout@v3
70+
uses: actions/checkout@v4
5071
with:
5172
lfs: true
5273
fetch-depth: ${{ env.depth }}
5374

54-
- uses: actions/setup-python@v4
75+
- uses: actions/setup-python@v5
5576
with:
56-
python-version: ${{ matrix.version.python }}
77+
python-version: ${{ matrix.upstream.python-version }}
5778
cache: pip
5879
cache-dependency-path: "**/pyproject.toml"
5980

@@ -62,7 +83,7 @@ jobs:
6283
version: 25.1.1
6384
license: ${{ secrets.GAMS_LICENSE }}
6485

65-
- uses: ts-graphviz/setup-graphviz@v1
86+
- uses: ts-graphviz/setup-graphviz@v2
6687
with:
6788
macos-skip-brew-update: true
6889

@@ -98,21 +119,23 @@ jobs:
98119
shell: bash
99120

100121
- name: Upload test coverage to Codecov.io
101-
uses: codecov/codecov-action@v3
122+
uses: codecov/codecov-action@v4
123+
with:
124+
token: ${{ secrets.CODECOV_TOKEN }} # required
102125

103126
pre-commit:
104127
name: Code quality
105128

106129
runs-on: ubuntu-latest
107130

108131
steps:
109-
- uses: actions/checkout@v3
110-
- uses: actions/setup-python@v4
111-
with: { python-version: "3.11" }
132+
- uses: actions/checkout@v4
133+
- uses: actions/setup-python@v5
134+
with: { python-version: "3.12" }
112135

113136
- name: Force recreation of pre-commit virtual environment for mypy
114137
if: github.event_name == 'schedule' # Comment this line to run on a PR
115138
run: gh cache list -L 999 | cut -f2 | grep pre-commit | xargs -I{} gh cache delete "{}" || true
116139
env: { GH_TOKEN: "${{ github.token }}" }
117140

118-
- uses: pre-commit/[email protected].0
141+
- uses: pre-commit/[email protected].1

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ repos:
88
pass_filenames: false
99

1010
language: python
11-
entry: bash -c ". ${PRE_COMMIT_MYPY_VENV:-/dev/null}/bin/activate 2>/dev/null; mypy $0 $@"
11+
entry: bash -c ". ${PRE_COMMIT_MYPY_VENV:-/dev/null}/bin/activate 2>/dev/null; mypy $0 $@; python -m pip list"
1212
additional_dependencies:
13-
- mypy >= 1.8.0
13+
- mypy >= 1.9.0
1414
- plotnine
1515
- pytest
1616
- sdmx1
@@ -20,7 +20,7 @@ repos:
2020
- "message-ix @ git+https://github.com/iiasa/message_ix.git@main"
2121
args: ["."]
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: v0.1.13
23+
rev: v0.3.2
2424
hooks:
2525
- id: ruff
2626
- id: ruff-format

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ prune message_ix_models/data/test/iea
33
prune message_ix_models/data/test/MESSAGEix-GLOBIOM_1.1_R11_no-policy_baseline
44
prune message_ix_models/data/test/ssp
55
prune message_ix_models/data/water/*
6+
# Larger package data
7+
# - Not distributed on PyPI.
8+
# - Should be fetched with Pooch from GitHub.
9+
exclude message_ix_models/data/ssp/*.gz
610
exclude message_ix_models/data/water/*.tar.xz

doc/api/util.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Commonly used:
3434
check_support
3535
convert_units
3636
copy_column
37+
datetime_now_with_tz
3738
ffill
3839
identify_nodes
3940
iter_keys
@@ -52,6 +53,7 @@ Commonly used:
5253
same_node
5354
same_time
5455
series_of_pint_quantity
56+
show_versions
5557

5658
.. automodule:: message_ix_models.util
5759
:members:

0 commit comments

Comments
 (0)