Skip to content

Commit 452a41e

Browse files
committed
Merge branch 'develop'
2 parents 03be7fb + 02399be commit 452a41e

9 files changed

Lines changed: 35 additions & 11 deletions

File tree

CHANGELOG.rst

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

5+
2.46.0 (2026-02-24)
6+
--------------------
7+
8+
- ECC-2219: High-level BUFR interface: set method not working for data keys
9+
- ECC-2220: Fix inadvertent string truncation in uncompressed BUFR messages
10+
- Fix path to BUFR md files
11+
- Add support for Python version 3.14
12+
513
2.45.0 (2025-01-16)
614
--------------------
715

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Before you submit a pull request, check that it meets these guidelines:
105105
your new functionality into a function with a docstring, and add the
106106
feature to the list in README.rst.
107107

108-
3. The pull request should work for Python 3.9, 3.10, 3.11, 3.12, 3.13 and for PyPy2 and PyPy3.
108+
3. The pull request should work for Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 and for PyPy2 and PyPy3.
109109
Check the tox results and make sure that the tests pass for all supported Python versions.
110110

111111

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ the following environment variable before importing eccodes::
127127
Usage
128128
-----
129129

130-
See examples of how to use the high-level BUFR interface: `BUFR_Tour.md <eccodes/highlevel/_bufr/BUFR_Tour.md>`_
131-
and `BUFR_Snippets.md <eccodes/highlevel/_bufr/BUFR_Snippets.md>`_.
130+
See examples of how to use the high-level BUFR interface: `BUFR_Tour.md <highlevel/_bufr/BUFR_Tour.md>`_
131+
and `BUFR_Snippets.md <highlevel/_bufr/BUFR_Snippets.md>`_.
132132

133133
Refer to the *ecCodes* `documentation pages <https://confluence.ecmwf.int/display/ECC/Documentation>`_
134134
for usage.

eccodes/highlevel/_bufr/coder.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,7 @@ def commit(self, entry) -> None:
345345
codes_set(self._handle, f"#{rank}#{key}", value)
346346
else:
347347
if array.dtype.type == np.str_:
348-
if array.size == 1: # [1]
349-
codes_set(self._handle, key, array.data[0][0])
350-
elif array.size > 1 and not np.any(array != array.data[0][0]):
348+
if array.size > 1 and not np.any(array != array.data[0][0]):
351349
codes_set_array(self._handle, key, array.data[0][0:1])
352350
else:
353351
codes_set_array(self._handle, key, array.data.ravel())
@@ -384,8 +382,6 @@ def commit(self, entry) -> None:
384382
codes_release(self._clone_handle)
385383
self._clone_handle = 0
386384

387-
# [1] This is a workaround for ECC-1623.
388-
#
389385
# [2] If all values in an array are the same, encode only a single scalar value.
390386
#
391387
# [3] The key 'centre' is also an alias for the header key 'headerCentre',

eccodes/highlevel/_bufr/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def is_missing(self, key: str) -> bool:
380380
return is_missing
381381

382382
def set(self, key: str, value: ValueLike) -> None:
383-
self.__setitem__(self, key, value)
383+
self.__setitem__(key, value)
384384

385385
def set_missing(self, key: str) -> None:
386386
key = Key.from_string(key)

gribapi/bindings.py

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

2424
import cffi
2525

26-
__version__ = "2.45.0"
26+
__version__ = "2.46.0"
2727

2828
LOG = logging.getLogger(__name__)
2929

scripts/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GIT_ECBUILD=https://github.com/ecmwf/ecbuild.git
1414
ECBUILD_VERSION=master
1515

1616
GIT_ECCODES=https://github.com/ecmwf/eccodes.git
17-
ECCODES_VERSION=2.45.0
17+
ECCODES_VERSION=2.46.0
1818
ECCODES_COMMON_CMAKE_OPTIONS="-DENABLE_PNG=1 -DENABLE_JPG=1 -DENABLE_NETCDF=0 -DENABLE_EXAMPLES=0"
1919

2020
GIT_AEC=https://github.com/MathisRosenhauer/libaec.git

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def shared(directory):
130130
"Programming Language :: Python :: 3.11",
131131
"Programming Language :: Python :: 3.12",
132132
"Programming Language :: Python :: 3.13",
133+
"Programming Language :: Python :: 3.14",
133134
"Programming Language :: Python :: Implementation :: CPython",
134135
"Programming Language :: Python :: Implementation :: PyPy",
135136
"Operating System :: OS Independent",

tests/test_bufr_data.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,22 @@ def test_data_assignment_with_non_native_types():
332332
bufr["satelliteIdentifier"] = np.int16(0)
333333
bufr["satelliteIdentifier"] = np.int32(0)
334334
bufr["latitude"] = np.float32(0)
335+
336+
337+
def test_data_set_string_uncompressed(): # ECC-2220
338+
bufr = BUFRMessage("BUFR4")
339+
bufr["unexpandedDescriptors"] = [1025]
340+
bufr["stormIdentifier"] = "70A"
341+
assert bufr["stormIdentifier"] == "70A"
342+
bufr.pack()
343+
assert bufr["stormIdentifier"] == "70A"
344+
345+
346+
def test_data_set_string_compressed(): # ECC-2220
347+
bufr = BUFRMessage("BUFR4")
348+
bufr["compressedData"] = 1
349+
bufr["unexpandedDescriptors"] = [1025]
350+
bufr["stormIdentifier"] = "70A"
351+
assert bufr["stormIdentifier"] == "70A"
352+
bufr.pack()
353+
assert bufr["stormIdentifier"] == "70A"

0 commit comments

Comments
 (0)