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

Replace resolved numpy workaround with dask workaround #245

Merged
merged 5 commits into from
Nov 12, 2024
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
22 changes: 16 additions & 6 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,29 @@ jobs:
- version: v3.4.0
python-version: "3.11"
extra-deps: '"dask < 2024.3.0" "genno < 1.25" "pandas < 2.0" "pytest == 8.0.0"' #
dask-dataframe: false
- version: v3.5.0
python-version: "3.11"
extra-deps: '"dask < 2024.3.0" "genno < 1.25" "pandas < 2.0" "pytest == 8.0.0"' #
dask-dataframe: false
- version: v3.6.0
python-version: "3.11"
extra-deps: '"dask < 2024.3.0" "genno < 1.25" "pandas < 2.0" "pytest == 8.0.0"' #
dask-dataframe: false
- version: v3.7.0
python-version: "3.11"
extra-deps: 'dask[dataframe] "genno < 1.25" "pytest == 8.0.0"' #
extra-deps: ' "genno < 1.25" "pytest == 8.0.0"' #
dask-dataframe: true
# Latest released version
- version: v3.8.0
python-version: "3.12"
extra-deps: 'dask[dataframe] "pytest == 8.0.0"' #
extra-deps: ' "pytest == 8.0.0"' #
dask-dataframe: true
# Development version
- version: main
python-version: "3.12"
extra-deps: 'dask[dataframe]' #
extra-deps: '' #
dask-dataframe: true

fail-fast: false

Expand Down Expand Up @@ -109,9 +115,13 @@ jobs:
pip install .[docs,tests] ${{ matrix.upstream.extra-deps }}
# TEMPORARY Work around hgrecco/pint#2007, unionai-oss/pandera#1685;
# see https://github.com/khaeru/genno/issues/140
pip install "pint != 0.24.0" "numpy < 2"
- name: Install specific dask versions as workaround
if: ${{ matrix.upstream.dask-dataframe }}
run: |
# TEMPORARY Work around dask v2024.11.0;
# see https://github.com/khaeru/genno/issues/149
pip install "dask[dataframe] < 2024.11.0"
- name: Configure local data path
run: |
Expand Down
2 changes: 1 addition & 1 deletion message_ix_models/model/water/data/demands.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def add_sectoral_demands(context: "Context") -> dict[str, pd.DataFrame]:
]
# create a new column and use np.select to assign
# values to it using our lists as arguments
h_act["commodity"] = np.select(conditions, values)
h_act["commodity"] = np.select(conditions, values, "Unknown commodity")
h_act["value"] = h_act["value"].abs()

hist_act = make_df(
Expand Down
Loading