Skip to content

Commit fa43b3c

Browse files
authored
Drop Python 3.8; upgrade to Pandas 2 (#813)
1 parent d7e5b00 commit fa43b3c

13 files changed

+38
-240
lines changed

.github/workflows/software-environments-nightly.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

.github/workflows/software-environments-stable.yml

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,15 @@ jobs:
3535
pytest_args: [tests]
3636
runtime-version: [upstream, latest]
3737
include:
38-
# Run stability tests on Python 3.8
38+
# Run stability tests on the lowest and highest versions of Python only
3939
- pytest_args: tests/stability
40-
python-version: "3.8"
40+
python-version: "3.9"
4141
runtime-version: upstream
4242
os: ubuntu-latest
4343
- pytest_args: tests/stability
44-
python-version: "3.8"
44+
python-version: "3.9"
4545
runtime-version: latest
4646
os: ubuntu-latest
47-
# Run stability tests on Python 3.10
4847
- pytest_args: tests/stability
4948
python-version: "3.10"
5049
runtime-version: upstream

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@ repos:
99
hooks:
1010
- id: isort
1111
language_version: python3
12+
- repo: https://github.com/asottile/pyupgrade
13+
rev: v3.3.2
14+
hooks:
15+
- id: pyupgrade
16+
args:
17+
- --py39-plus
1218
- repo: https://github.com/psf/black
1319
rev: 23.1.0
1420
hooks:
1521
- id: black
1622
language_version: python3
23+
args:
24+
- --target-version=py39
1725
exclude: ^alembic/versions/
1826
- repo: https://github.com/pycqa/flake8
1927
rev: 6.0.0

AB_environments/AB_baseline.conda.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
- pip
1111
- coiled >=0.2.54
1212
- numpy ==1.23.5
13-
- pandas ==1.5.3 # 2.0.0 requires a newer version of xarray
13+
- pandas ==2.0.1
1414
- dask ==2023.4.0
1515
- distributed ==2023.4.0
1616
- fsspec ==2023.3.0
@@ -25,7 +25,7 @@ dependencies:
2525
- scikit-learn ==1.2.2
2626
- ipycytoscape ==1.3.3
2727
- click ==8.1.3
28-
- xarray ==2023.1.0 # Last version supporting Python 3.8
28+
- xarray ==2023.4.2
2929
- zarr ==2.14.2
3030
- cftime ==1.6.2
3131
- msgpack-python ==1.0.5

AB_environments/AB_sample.conda.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
- pip
1616
- coiled >=0.2.54
1717
- numpy ==1.23.5
18-
- pandas ==1.5.3 # 2.0.0 requires a newer version of xarray
18+
- pandas ==2.0.1
1919
- dask ==2023.4.0
2020
- distributed ==2023.4.0
2121
- fsspec ==2023.3.0
@@ -30,7 +30,7 @@ dependencies:
3030
- scikit-learn ==1.2.2
3131
- ipycytoscape ==1.3.3
3232
- click ==8.1.3
33-
- xarray ==2023.1.0 # Last version supporting Python 3.8
33+
- xarray ==2023.4.2
3434
- zarr ==2.14.2
3535
- cftime ==1.6.2
3636
- msgpack-python ==1.0.5

AB_environments/README.md

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ channels:
3434
dependencies:
3535
- python =3.9
3636
- <copy-paste from recipe/meta.yaml, minus bits you want to change>
37-
- pip:
38-
- dask ==2023.4.1
39-
- distributed ==2023.4.1
37+
# Changes from the recipe start here
38+
- dask ==2023.4.1
39+
- distributed ==2023.4.1
4040
```
4141
Instead of published packages, you could also use arbitrary git hashes of arbitrary
4242
forks, e.g.
4343
4444
```yaml
4545
- pip:
46-
- dask ==2023.4.2
46+
- git+https://github.com/dask/dask@b85bf5be72b02342222c8a0452596539fce19bce
4747
- git+https://github.com/yourname/distributed@803c624fcef99e3b6f3f1c5bce61a2fb4c9a1717
4848
```
4949
@@ -143,48 +143,19 @@ etc.
143143

144144

145145
### Complete example
146-
You want to test the impact of disabling work stealing. You'll create at least 4 files:
146+
You want to test the impact of disabling work stealing on the latest version of dask.
147+
You'll create at least 4 files:
147148

148149
- `AB_environments/AB_baseline.conda.yaml`:
149150
```yaml
150151
channels:
151152
- conda-forge
152153
dependencies:
153154
- python =3.9
154-
- pip
155-
- coiled >=0.2.54
156-
- numpy ==1.23.5
157-
- pandas ==1.5.3
158-
- dask ==2023.4.0
159-
- distributed ==2023.4.0
160-
- fsspec ==2023.3.0
161-
- s3fs ==2023.3.0
162-
- gcsfs ==2023.3.0
163-
- pyarrow ==11.0.0
164-
- jupyterlab ==3.6.2
165-
- dask-labextension ==6.1.0
166-
- lz4 ==4.3.2
167-
- ipywidgets ==8.0.4
168-
- numba ==0.56.4
169-
- scikit-learn ==1.2.2
170-
- ipycytoscape ==1.3.3
171-
- click ==8.1.3
172-
- xarray ==2023.1.0
173-
- zarr ==2.14.2
174-
- cftime ==1.6.2
175-
- msgpack-python ==1.0.5
176-
- cloudpickle ==2.2.1
177-
- tornado ==6.2
178-
- toolz ==0.12.0
179-
- zict ==3.0.0
180-
- xgboost ==1.7.4
181-
- dask-ml ==2023.3.24
182-
- openssl >1.1.0g
183-
- optuna ==3.1.0
184-
- scipy ==1.10.1
185-
- sqlalchemy ==1.4.46
186-
- pynvml ==11.5.0
187-
- bokeh ==3.1.0
155+
- coiled
156+
- dask
157+
- distributed
158+
- s3fs
188159
```
189160
- `AB_environments/AB_baseline.dask.yaml`: (empty file)
190161
- `AB_environments/AB_baseline.cluster.yaml`: (empty file)
@@ -201,9 +172,7 @@ distributed:
201172
repeat: 5
202173
test_null_hypothesis: true
203174
targets:
204-
- tests/runtime
205175
- tests/benchmarks
206-
- tests/stability
207176
h2o_datasets:
208177
- 5 GB (parquet+pyarrow)
209178
max_parallel:
@@ -213,8 +182,9 @@ max_parallel:
213182

214183
### 6. Run CI
215184
- `git push`. Note: you should *not* open a Pull Request.
216-
- Open https://github.com/coiled/benchmarks/actions/workflows/ab_tests.yml and wait
217-
for the run to complete.
185+
- Open [the GitHub Actions tab]
186+
(https://github.com/coiled/benchmarks/actions/workflows/ab_tests.yml)
187+
and wait for the run to complete.
218188
- Open the run from the link above. In the Summary tab, scroll down and download the
219189
`static-dashboard` artifact.
220190
Note: artifacts will appear only after the run is complete.

ci/scripts/dask_config_to_env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from __future__ import annotations
77

88
import sys
9-
from typing import Iterator
9+
from collections.abc import Iterator
1010

1111
import yaml
1212

dashboard.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pathlib
1010
from collections.abc import Callable
1111
from textwrap import dedent
12-
from typing import Any, Literal, NamedTuple, Optional
12+
from typing import Any, Literal, NamedTuple
1313
from urllib.parse import quote
1414

1515
import altair
@@ -135,7 +135,7 @@ def confidence(
135135
pivot_groups = pivot.groupby(["fullname", "fullname_no_category"])[["diff"]]
136136
x_neg = numpy.linspace(-0.8, 0, 17)
137137
x_pos = numpy.linspace(0, 0.8, 17)
138-
conf_neg, conf_pos = [
138+
conf_neg, conf_pos = (
139139
# DataFrame with 1 row per element of x_neg/x_pos and columns
140140
# [fullname, fullname_no_category, x, xlabel, p, color]
141141
(
@@ -147,7 +147,7 @@ def confidence(
147147
(x_neg, "<", operator.lt, -1),
148148
(x_pos, ">", operator.gt, 1),
149149
)
150-
]
150+
)
151151
return pandas.concat([conf_neg, conf_pos], axis=0)
152152

153153

@@ -614,7 +614,7 @@ def make_details_html_report(
614614
)
615615

616616

617-
def make_grafana_url(cluster_name, start, end) -> Optional[str]:
617+
def make_grafana_url(cluster_name, start, end) -> str | None:
618618
if cluster_name:
619619
# Add some padding to compensate for clock differences between
620620
# GitHub actions and Prometheus, as well for sample granularity
@@ -667,7 +667,7 @@ def make_index_html_report(
667667

668668
def runtime_sort_key(runtime: str) -> tuple:
669669
"""Runtimes are in the format coiled-<coiled-runtime version>-py<python version>
670-
e.g. coiled-latest-py3.8
670+
e.g. coiled-latest-py3.9
671671
672672
Sort them by coiled-runtime and python version, both descending.
673673
"""

0 commit comments

Comments
 (0)