Skip to content

Commit ac08ddf

Browse files
committed
Release 1.6.1
2 parents 0e7c475 + 14f3f51 commit ac08ddf

File tree

7 files changed

+49
-58
lines changed

7 files changed

+49
-58
lines changed

.github/workflows/cd.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: cd
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
pypi:
10+
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
11+
secrets: inherit

.github/workflows/check-and-publish.yml

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
platform: [ubuntu-latest, macos-latest, windows-latest]
30-
python-version: ["3.8", "3.9", "3.10", "3.11"]
31-
method: ["conda", "ecmwflibs"]
30+
python-version: ['3.8', '3.9', '3.10', '3.11']
31+
method: ['conda', 'ecmwflibs']
3232
exclude:
3333
- platform: macos-latest
34-
python-version: "3.9"
35-
method: "ecmwflibs"
34+
python-version: '3.9'
35+
method: 'ecmwflibs'
3636

3737
name: Python ${{ matrix.python-version }} on ${{ matrix.platform }} (${{ matrix.method }})
3838
runs-on: ${{ matrix.platform }}
@@ -79,8 +79,8 @@ jobs:
7979
- run: pytest
8080
if: matrix.method == 'conda' && matrix.platform == 'windows-latest'
8181
env:
82-
ECCODES_DEFINITION_PATH: "C:/Miniconda/Library/share/eccodes/definitions"
83-
ECCODES_SAMPLES_PATH: "C:/Miniconda/Library/share/eccodes/samples"
82+
ECCODES_DEFINITION_PATH: 'C:/Miniconda/Library/share/eccodes/definitions'
83+
ECCODES_SAMPLES_PATH: 'C:/Miniconda/Library/share/eccodes/samples'
8484

8585
- run: pytest
8686
if: matrix.method != 'conda' || matrix.platform != 'windows-latest'
@@ -89,39 +89,4 @@ jobs:
8989

9090
- name: Upload coverage to Codecov
9191
uses: codecov/codecov-action@v1
92-
if: "false"
93-
94-
deploy:
95-
if: ${{ github.event_name == 'release' }}
96-
97-
name: Upload to Pypi
98-
needs: checks
99-
100-
runs-on: ubuntu-latest
101-
102-
steps:
103-
- uses: actions/checkout@v3
104-
105-
- name: Set up Python
106-
uses: actions/setup-python@v4
107-
with:
108-
python-version: "3.x"
109-
110-
- name: Install dependencies
111-
run: |
112-
python -m pip install --upgrade pip
113-
pip install setuptools wheel twine
114-
115-
- name: Check version
116-
run: |
117-
release=${GITHUB_REF##*/}
118-
version=$(python setup.py --version)
119-
test "$release" == "$version"
120-
121-
- name: Build and publish
122-
env:
123-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
124-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
125-
run: |
126-
python setup.py sdist
127-
twine upload dist/*
92+
if: 'false'

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog for eccodes-python
33
============================
44

5+
1.6.1 (2023-10-02)
6+
--------------------
7+
8+
- ECC-1693: Update minimum recommended version
9+
- Fix flake8 warning E721
510

611
1.6.0 (2023-07-11)
712
--------------------

gribapi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
from .gribapi import __version__, lib
1515

1616
# The minimum recommended version for the ecCodes package
17-
min_recommended_version_str = "2.21.0"
18-
min_recommended_version_int = 22100
17+
min_recommended_version_str = "2.31.0"
18+
min_recommended_version_int = 23100
1919

2020
if lib.grib_get_api_version() < min_recommended_version_int:
2121
import warnings

gribapi/bindings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import cffi
2323

24-
__version__ = "1.6.0"
24+
__version__ = "1.6.1"
2525

2626
LOG = logging.getLogger(__name__)
2727

gribapi/gribapi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ def grib_index_get_long(indexid, key):
14491449
\b Examples: \ref grib_index.py "grib_index.py"
14501450
14511451
@param indexid id of an index created from a file. The index must have been created with the key in argument.
1452-
@param key key for wich the values are returned
1452+
@param key key for which the values are returned
14531453
@return tuple with values of key in index
14541454
@exception CodesInternalError
14551455
"""
@@ -1475,7 +1475,7 @@ def grib_index_get_string(indexid, key):
14751475
\b Examples: \ref grib_index.py "grib_index.py"
14761476
14771477
@param indexid id of an index created from a file. The index must have been created with the key in argument.
1478-
@param key key for wich the values are returned
1478+
@param key key for which the values are returned
14791479
@return tuple with values of key in index
14801480
@exception CodesInternalError
14811481
"""
@@ -1502,7 +1502,7 @@ def grib_index_get_double(indexid, key):
15021502
\b Examples: \ref grib_index.py "grib_index.py"
15031503
15041504
@param indexid id of an index created from a file. The index must have been created with the key in argument.
1505-
@param key key for wich the values are returned
1505+
@param key key for which the values are returned
15061506
@return tuple with values of key in index
15071507
@exception CodesInternalError
15081508
"""

tests/test_eccodes.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ def test_codes_set_samples_path():
5858

5959
def test_api_version():
6060
vs = eccodes.codes_get_api_version()
61-
assert type(vs) == str
61+
assert type(vs) is str
6262
assert len(vs) > 0
6363
assert vs == eccodes.codes_get_api_version(str)
6464
vi = eccodes.codes_get_api_version(int)
65-
assert type(vi) == int
65+
assert type(vi) is int
6666
assert vi > 20000
6767
print(vi)
6868

@@ -276,23 +276,27 @@ def test_grib_get_array():
276276
assert pls == ["ecmf"]
277277
dvals = eccodes.codes_get_array(gid, "values")
278278
assert len(dvals) == 138346
279-
assert type(dvals[0]) == np.float64
279+
assert type(dvals[0]) is np.float64
280280
eccodes.codes_release(gid)
281281

282282

283-
def _test_grib_get_array_single_precision():
283+
def test_grib_get_array_single_precision():
284+
if eccodes.codes_get_api_version(int) < 23100:
285+
print("Test skipped (ecCodes version too old)")
286+
return
287+
284288
gid = eccodes.codes_grib_new_from_samples("reduced_gg_pl_160_grib2")
285289

286290
dvals = eccodes.codes_get_array(gid, "values", ktype=float)
287-
assert type(dvals[0]) == np.float64
291+
assert type(dvals[0]) is np.float64
288292
fvals = eccodes.codes_get_array(gid, "values", ktype=np.float32)
289-
assert type(fvals[0]) == np.float32
293+
assert type(fvals[0]) is np.float32
290294
fvals = eccodes.codes_get_float_array(gid, "values")
291-
assert type(fvals[0]) == np.float32
295+
assert type(fvals[0]) is np.float32
292296
dvals = eccodes.codes_get_values(gid)
293-
assert type(dvals[0]) == np.float64
297+
assert type(dvals[0]) is np.float64
294298
fvals = eccodes.codes_get_values(gid, np.float32)
295-
assert type(fvals[0]) == np.float32
299+
assert type(fvals[0]) is np.float32
296300

297301
eccodes.codes_release(gid)
298302

@@ -853,7 +857,11 @@ def test_codes_bufr_key_is_header():
853857
assert not eccodes.codes_bufr_key_is_header(bid, "#6#brightnessTemperature")
854858

855859

856-
def _test_codes_bufr_key_is_coordinate():
860+
def test_codes_bufr_key_is_coordinate():
861+
if eccodes.codes_get_api_version(int) < 23100:
862+
print("Test skipped (ecCodes version too old)")
863+
return
864+
857865
bid = eccodes.codes_bufr_new_from_samples("BUFR4")
858866
assert not eccodes.codes_bufr_key_is_coordinate(bid, "edition")
859867

@@ -865,6 +873,8 @@ def _test_codes_bufr_key_is_coordinate():
865873
assert eccodes.codes_bufr_key_is_coordinate(bid, "#14#timePeriod")
866874
assert not eccodes.codes_bufr_key_is_coordinate(bid, "dewpointTemperature")
867875

876+
eccodes.codes_release(bid)
877+
868878

869879
def test_bufr_extract_headers():
870880
fpath = get_sample_fullpath("BUFR4_local.tmpl")

0 commit comments

Comments
 (0)