Skip to content
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
16 changes: 13 additions & 3 deletions .github/workflows/build-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:
# if: false # for temporarily disabling for debugging

runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]
container: dockcross/manylinux_2_28-x64:latest
container:
image: dockcross/manylinux_2_28-x64:latest
#options: --pull always

name: Build manylinux_2_28-x64

Expand Down Expand Up @@ -91,14 +93,22 @@ jobs:
name: wheel-manylinux2014-3.12
path: wheelhouse/*.whl

# ################################################################
- run: ./scripts/wheel-linux.sh 3.13
- uses: actions/upload-artifact@v4
name: Upload wheel 3.13
with:
name: wheel-manylinux2014-3.13
path: wheelhouse/*.whl

test:

needs: build

strategy:
fail-fast: false
matrix: # We don't test 3.6, as it is not supported anymore by github actions
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]

Expand All @@ -122,7 +132,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

needs: [test, build]

Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/build-wheel-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ jobs:
path: wheelhouse/*.whl
- run: rm -fr wheelhouse

- run: ./scripts/wheel-macos.sh "3.13"
- run: ls -l wheelhouse
- uses: actions/upload-artifact@v4
name: Upload wheel 3.13 ${{ matrix.arch_type }}
with:
name: wheel-macos-${{ matrix.arch_type }}-3.13
path: wheelhouse/*.whl
- run: rm -fr wheelhouse

test:
needs: build

Expand All @@ -100,7 +109,7 @@ jobs:
max-parallel: 1
matrix:
arch_type: [ARM64, X64]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]

Expand Down Expand Up @@ -130,14 +139,16 @@ jobs:
max-parallel: 1
matrix:
arch_type: [ARM64, X64]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]

steps:

- run: mkdir artifact-${{ matrix.arch_type }}-${{ matrix.python-version }}

- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: wheel-macos-${{ matrix.arch_type }}-${{ matrix.python-version }}
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/build-wheel-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,29 @@ jobs:

################################################################

- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.13"
architecture: ${{ matrix.architecture }}

- run: ./scripts/wheel-windows.sh "3.13"
- uses: actions/upload-artifact@v4
name: Upload wheel 3.13
with:
name: wheel-windows-3.13-${{ matrix.architecture }}
path: wheelhouse/*.whl

################################################################


test:
needs: build
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
architecture: ["x64"]

defaults:
Expand Down Expand Up @@ -195,7 +210,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
architecture: ["x64"]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
method: ['conda', 'ecmwflibs']
exclude:
- platform: macos-latest
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Changelog for eccodes-python
============================

2.39.2 (2025-01-27)
--------------------

- GitHub pull request #109: Allow setting of array in highlevel.Message.set
- Add support for Python version 3.13


2.39.1 (2024-12-10)
--------------------

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Before you submit a pull request, check that it meets these guidelines:
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.

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


Expand Down
8 changes: 5 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ https://confluence.ecmwf.int/display/ECC/ecCodes+installation
You may run a simple selfcheck command to ensure that your system is set up correctly::

$ python -m eccodes selfcheck
Found: ecCodes v2.37.0.
Found: ecCodes v2.39.0.
Your system is ready.


Expand Down Expand Up @@ -126,15 +126,17 @@ https://github.com/ecmwf/eccodes-python

Please see the CONTRIBUTING.rst document for the best way to help.

Maintainer:
Maintainers:

- `Shahram Najm <https://github.com/shahramn>`_ - `ECMWF <https://ecmwf.int>`_
- `Eugen Betke <https://github.com/joobog>`_ - `ECMWF <https://ecmwf.int>`_

Contributors:

- `Iain Russell <https://github.com/iainrussell>`_ - `ECMWF <https://ecmwf.int>`_
- `Alessandro Amici <https://github.com/alexamici>`_ - `B-Open <https://bopen.eu>`_

See also the list of `contributors <https://github.com/ecmwf/eccodes-python/contributors>`_
See also the list of other `contributors <https://github.com/ecmwf/eccodes-python/contributors>`_
who participated in this project.

.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ idna==3.7
# via requests
imagesize==1.1.0
# via sphinx
jinja2==3.1.4
jinja2==3.1.5
# via sphinx
markupsafe==2.1.5
# via jinja2
Expand Down
20 changes: 10 additions & 10 deletions eccodes/highlevel/message.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import io
from contextlib import contextmanager

import numpy as np

import eccodes

_TYPES_MAP = {
Expand Down Expand Up @@ -95,23 +97,21 @@ def set(self, *args, check_values: bool = True):

for name, value in key_values.items():
with raise_keyerror(name):
eccodes.codes_set(self._handle, name, value)
if np.ndim(value) > 0:
eccodes.codes_set_array(self._handle, name, value)
else:
eccodes.codes_set(self._handle, name, value)

if check_values:
# Check values just set
for name, value in key_values.items():
cast_value = value
if isinstance(value, str):
saved_value = eccodes.codes_get_string(self._handle, name)
elif isinstance(value, int):
saved_value = eccodes.codes_get_long(self._handle, name)
if type(value) in _TYPES_MAP.values():
saved_value = self.get(f"{name}:{type(value).__name__}")
else:
saved_value = self.get(name)
if not isinstance(value, type(saved_value)):
cast_value = type(saved_value)(value)
if saved_value != cast_value:
if not np.all(saved_value == value):
raise ValueError(
f"Unexpected retrieved value {saved_value} for key {name}. Expected {cast_value}"
f"Unexpected retrieved value {saved_value} for key {name}. Expected {value}"
)

def get_array(self, name):
Expand Down
2 changes: 1 addition & 1 deletion gribapi/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import cffi

__version__ = "2.39.1"
__version__ = "2.39.2"

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 0 additions & 2 deletions scripts/build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ cd $TOPDIR/build-binaries/eccodes

# We disable JASPER because of a linking issue. JPEG support comes from
# other libraries (e.g. openjpeg)
# For performance, we do not enable thread-safety (would be -DENABLE_THREADS=1 -DECCODES_OMP_THREADS=1),
# but may want to consider in the future
$ARCH $TOPDIR/src/ecbuild/bin/ecbuild \
$TOPDIR/src/eccodes \
-GNinja \
Expand Down
2 changes: 1 addition & 1 deletion scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GIT_ECBUILD=https://github.com/ecmwf/ecbuild.git
ECBUILD_VERSION=master

GIT_ECCODES=https://github.com/ecmwf/eccodes.git
ECCODES_VERSION=2.39.1
ECCODES_VERSION=2.39.2
ECCODES_COMMON_CMAKE_OPTIONS="-DENABLE_PNG=1 -DENABLE_JPG=1 -DENABLE_NETCDF=0 -DENABLE_EXAMPLES=0"

GIT_AEC=https://github.com/MathisRosenhauer/libaec.git
Expand Down
8 changes: 4 additions & 4 deletions scripts/wheel-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ TOPDIR=$(/bin/pwd)

LD_LIBRARY_PATH=$TOPDIR/install/lib:$TOPDIR/install/lib64:$LD_LIBRARY_PATH

sudo /opt/python/cp${version}-cp${version}*/bin/pip3 install 'setuptools>=72.1.0'
/opt/python/cp${version}-cp${version}*/bin/pip3 list
sudo /opt/python/cp${version}-cp${version}/bin/pip3 install 'setuptools>=72.1.0'
/opt/python/cp${version}-cp${version}/bin/pip3 list

rm -fr dist wheelhouse
/opt/python/cp${version}-cp${version}*/bin/python3 setup.py --binary-wheel bdist_wheel
/opt/python/cp${version}-cp${version}/bin/python3 setup.py --binary-wheel bdist_wheel

# Do it twice to get the list of libraries

Expand All @@ -35,6 +35,6 @@ pip3 install -r scripts/requirements.txt
python3 ./scripts/copy-licences.py libs

rm -fr dist wheelhouse
/opt/python/cp${version}-cp${version}*/bin/python3 setup.py --binary-wheel bdist_wheel
/opt/python/cp${version}-cp${version}/bin/python3 setup.py --binary-wheel bdist_wheel
auditwheel repair dist/*.whl
rm -fr dist
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def shared(directory):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: OS Independent",
Expand Down
2 changes: 2 additions & 0 deletions tests/test_highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def test_message_set_plain():
message.set("centre", "ecmf")
vals = np.arange(message.get("numberOfValues"), dtype=np.float32)
message.set_array("values", vals)
assert np.all(message.get("values") == vals)
message.set("values", vals)
message.set_missing(missing_key)
assert message.get("centre") == "ecmf"
assert np.all(message.get("values") == vals)
Expand Down
Loading