Skip to content

Commit c66cbc2

Browse files
authored
Merge branch 'main' into fix_tests
2 parents 8cc432d + 0cc033c commit c66cbc2

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

.github/workflows/python-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
- name: Build package
2828
run: python -m build
2929
- name: Publish package
30-
uses: pypa/gh-action-pypi-publish@v1.10.1
30+
uses: pypa/gh-action-pypi-publish@v1.12.4

.github/workflows/pythonpackage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ jobs:
6666
run: |
6767
pytest -v --cov dscim --cov-report term-missing --cov-report xml
6868
- name: Upload coverage to Codecov
69-
uses: codecov/codecov-action@v4
69+
uses: codecov/codecov-action@v5
7070
env:
7171
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
- Python version for running automated tests in CI upgraded from Python 3.10 to 3.12 ([PR #270](https://github.com/ClimateImpactLab/dscim/pull/270), [@brews](https://github.com/brews)).
1212

13+
### Fixed
14+
15+
- Minor code cleanup. Switch old %-string formatting to use f-strings ([PR #351](https://github.com/ClimateImpactLab/dscim/pull/351), [@brews](https://github.com/brews)).
16+
1317
### Removed
1418

1519
- Removed [`preprocessing/climate`](https://github.com/ClimateImpactLab/dscim/tree/25dfb39637d5716662a3ec636028d5066ddb10bb/src/dscim/preprocessing/climate) and [`preprocessing/misc`](https://github.com/ClimateImpactLab/dscim/tree/25dfb39637d5716662a3ec636028d5066ddb10bb/src/dscim/preprocessing/misc) subpackages. ([PR #249](https://github.com/ClimateImpactLab/dscim/pull/249), [@JMGilbert](https://github.com/JMGilbert))

requirements.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# This is used to build the CI test environment and so Github can track dependencies.
22
xarray==2024.3.0
3-
pandas==2.2.2
3+
pandas==2.2.3
44
numpy==1.26.4
5-
matplotlib==3.9.2
6-
dask[array, distributed]==2024.8.2
5+
matplotlib==3.10.1
6+
dask[array, distributed]==2025.2.0
77
requests==2.32.3
8-
statsmodels==0.14.2
9-
pytest==8.3.2
10-
pytest-cov==5.0.0
11-
zarr==2.18.3
12-
ruff==0.6.4
13-
netcdf4==1.7.0
14-
h5netcdf==1.3.0
8+
statsmodels==0.14.4
9+
pytest==8.3.5
10+
pytest-cov==6.0.0
11+
zarr==2.18.4
12+
ruff==0.8.6
13+
netcdf4==1.7.2
14+
h5netcdf==1.6.1
1515
impactlab-tools==0.6.0
1616
p_tqdm==1.4.2
17-
pyarrow==17.0.0
17+
pyarrow==19.0.1
1818
numcodecs=0.15.1

src/dscim/utils/rff.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ def process_ssp_sample(ssppath):
160160
ssp_df = pd.read_csv(ssppath, skiprows=11)
161161
ssp_df = ssp_df[ssp_df.year >= 2010]
162162
ssp_df["loginc"] = np.log(ssp_df.value)
163-
ssp_df["isoyear"] = ssp_df.apply(lambda row: "%s:%d" % (row.iso, row.year), axis=1)
163+
ssp_df["isoyear"] = ssp_df.apply(lambda row: f"{row.iso}:{row.year:d}", axis=1)
164164
ssp_df["yearscen"] = ssp_df.apply(
165-
lambda row: "%d:%s/%s" % (row.year, row.model, row.scenario), axis=1
165+
lambda row: f"{row.year:d}:{row.model}/{row.scenario}", axis=1
166166
)
167167

168168
return ssp_df
@@ -176,7 +176,7 @@ def process_rff_sample(i, rffpath, ssp_df, outdir, HEADER, **storage_options):
176176
increments for a single RFF-SP
177177
"""
178178

179-
read_feather = os.path.join(rffpath, "run_%d.feather" % i)
179+
read_feather = os.path.join(rffpath, f"run_{i:d}.feather")
180180
rff_raw = pd.read_feather(read_feather)
181181
rff_raw.rename(columns={"Year": "year", "Country": "iso"}, inplace=True)
182182

@@ -199,7 +199,7 @@ def process_rff_sample(i, rffpath, ssp_df, outdir, HEADER, **storage_options):
199199
rff_df = pd.concat((rff_df, all_year_df))
200200

201201
rff_df["loginc"] = np.log(rff_df.value)
202-
rff_df["isoyear"] = rff_df.apply(lambda row: "%s:%d" % (row.iso, row.year), axis=1)
202+
rff_df["isoyear"] = rff_df.apply(lambda row: f"{row.iso}:{row.year:d}", axis=1)
203203

204204
rff_df = pd.merge(rff_df, rff_raw, on=["year", "iso"], how="left")
205205

0 commit comments

Comments
 (0)