Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f4ae5ef
eckit::geo Grid
pmaciel Apr 9, 2026
6851eae
eckit::geo Grid (Arakawa C)
pmaciel Apr 16, 2026
4c78079
eckit::geo Grid (order::Scan)
pmaciel Apr 16, 2026
16940ae
eckit::geo Grid (Arakawa C Unified Model version)
pmaciel Apr 17, 2026
bc1d873
eckit::geo Grid
pmaciel Apr 19, 2026
852f6a0
Cleanup
pmaciel Apr 20, 2026
bcbf550
eckit::geo Grid (Arakawa C Unified Model version)
pmaciel Apr 22, 2026
e2a09aa
eckit::geo Grid
pmaciel Apr 22, 2026
29885cb
eckit::geo Order
pmaciel Apr 30, 2026
77e015d
eckit::geo requires eckit::codec + eckit::spec
pmaciel Apr 30, 2026
fe56204
Cleanup
pmaciel May 7, 2026
3a64924
eckit::LibEcKit version/sha1 as eckit.__version__/__git_sha1__, eckit…
pmaciel May 9, 2026
6f995df
eckit.geo.Grid.order
pmaciel May 9, 2026
1c22d96
eckit::geo::Grid cleanup
pmaciel May 10, 2026
cd95b1f
eckit::geo::Grid HEALPix cacheable coordinates
pmaciel May 10, 2026
51220e8
eckit::geo::Grid ReducedGaussian area/domain
pmaciel May 10, 2026
06a6056
eckit::geo::Grid
pmaciel May 10, 2026
b58c480
eckit::geo::Grid delayed caching
pmaciel May 17, 2026
ff99315
eckit-geo-grid-cache
pmaciel May 22, 2026
05c5b6c
eckit::geo HEALPix simpler regular expression
pmaciel May 22, 2026
14b6fb5
eckit::geo::Grid
pmaciel May 26, 2026
4416d90
eckit::geo::Grid distinct_latitudes/longitudes
pmaciel Jun 8, 2026
d703209
eckit-python bindings (modules eckit, eckit.geo) now cmake-built
pmaciel Jun 8, 2026
3649671
eckit-python tools (eckit-geo-share-download)
pmaciel Jun 8, 2026
b8c54cd
eckit-python stream
pmaciel Jun 9, 2026
4c9e241
eckit-python
pmaciel Jun 9, 2026
a396d77
[python] update eckit building
tmi Jun 9, 2026
5e07b85
eckit:geo cache testing
pmaciel Jun 9, 2026
da9af41
[python] update pyproject exclude
tmi Jun 10, 2026
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
31 changes: 19 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ endif()

ecbuild_add_option( FEATURE ECKIT_GEO
DEFAULT ON
CONDITION eckit_HAVE_ECKIT_CODEC AND eckit_HAVE_ECKIT_SPEC
DESCRIPTION "eckit::geo geometry library" )

ecbuild_add_option( FEATURE GEO_CACHING
Expand All @@ -205,11 +206,6 @@ ecbuild_add_option( FEATURE GEO_AREA_SHAPEFILE
REQUIRED_PACKAGES shapelib
DESCRIPTION "eckit::geo geometry library support for shapefiles" )

set( ECKIT_GEO_CODEC_GRIDS OFF )
if( eckit_HAVE_ECKIT_CODEC AND eckit_HAVE_LZ4 )
set( ECKIT_GEO_CODEC_GRIDS ON )
endif()

if( eckit_HAVE_GEO_AREA_SHAPEFILE )
if( NOT TARGET shapelib::shp OR NOT TARGET libzip::zip )
message( FATAL_ERROR "eckit::geo geometry library support for shapefiles requires the shapelib::shp and libzip::zip libraries" )
Expand Down Expand Up @@ -303,11 +299,16 @@ ecbuild_add_option( FEATURE PROJ
DESCRIPTION "support PROJ-based projections"
REQUIRED_PACKAGES "PROJ 9.1.1" )

ecbuild_add_option(
FEATURE DOCS
DEFAULT OFF
DESCRIPTION "Enable documentation generation"
)
ecbuild_add_option( FEATURE DOCS
DEFAULT OFF
DESCRIPTION "Enable documentation generation" )

### Python bindings

ecbuild_add_option( FEATURE PYTHON
DEFAULT OFF
DESCRIPTION "Build Python bindings (Cython)"
REQUIRED_PACKAGES "Python3 COMPONENTS Interpreter Development" )

### c math library, needed when including "math.h"

Expand Down Expand Up @@ -340,9 +341,15 @@ include(cmake/compiler_warnings.cmake) # optionally handle compiler specific war
set( PERSISTENT_NAMESPACE "eckit" CACHE INTERNAL "" ) # needed for generating .b files for persistent support

add_subdirectory( src )
if(eckit_HAVE_DOCS)
add_subdirectory(docs)

if( eckit_HAVE_DOCS )
add_subdirectory( docs )
endif()

if( eckit_HAVE_PYTHON )
add_subdirectory( python )
endif()

add_subdirectory( share )

if( eckit_HAVE_TESTS )
Expand Down
95 changes: 95 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# (C) Copyright 1996- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.

find_program(CYTHON_EXECUTABLE NAMES cython cython3
HINTS ${Python3_ROOT_DIR}/bin
DOC "Cython transpiler"
REQUIRED)

message(STATUS "eckit Python bindings: Cython=${CYTHON_EXECUTABLE}")

set(_src ${CMAKE_CURRENT_SOURCE_DIR}/eckit/src/_eckit)

set(_cython_flags
--cplus
--directive language_level=3
--directive c_string_type=unicode
--directive c_string_encoding=utf8
)

# Install destination: prefix-relative site-packages
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '${CMAKE_INSTALL_PREFIX}', 'base': '${CMAKE_INSTALL_PREFIX}'}))"
OUTPUT_VARIABLE _python_sitearch
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(ECKIT_PYTHON_INSTALL_DIR ${_python_sitearch} CACHE PATH
"Install directory for eckit Python extensions")

# ---- eckit._eckit ----
set(_eckit_cpp ${CMAKE_CURRENT_BINARY_DIR}/_eckit.cpp)
add_custom_command(
OUTPUT ${_eckit_cpp}
COMMAND ${CYTHON_EXECUTABLE} ${_cython_flags}
-I ${_src}
${_src}/_eckit.pyx
-o ${_eckit_cpp}
DEPENDS
${_src}/_eckit.pyx
${_src}/eckit.pxd
${_src}/std.pxd
COMMENT "Cythonizing _eckit.pyx"
VERBATIM
)

Python3_add_library(_eckit MODULE WITH_SOABI
${_eckit_cpp}
${_src}/eckit.cc
)

target_include_directories(_eckit PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src ${_src})
target_link_libraries(_eckit PRIVATE eckit)

install(TARGETS _eckit DESTINATION ${ECKIT_PYTHON_INSTALL_DIR}/eckit COMPONENT python)
install(FILES
eckit/src/eckit/__init__.py
eckit/src/eckit/stream.py
DESTINATION ${ECKIT_PYTHON_INSTALL_DIR}/eckit COMPONENT python)
install(FILES
eckit/src/eckit/tools/__init__.py
eckit/src/eckit/tools/geo_share_download.py
DESTINATION ${ECKIT_PYTHON_INSTALL_DIR}/eckit/tools COMPONENT python)

# ---- eckit.geo._eckit_geo ----
if(eckit_HAVE_ECKIT_GEO)
set(_eckit_geo_cpp ${CMAKE_CURRENT_BINARY_DIR}/_eckit_geo.cpp)
add_custom_command(
OUTPUT ${_eckit_geo_cpp}
COMMAND ${CYTHON_EXECUTABLE} ${_cython_flags}
-I ${_src}
${_src}/_eckit_geo.pyx
-o ${_eckit_geo_cpp}
DEPENDS
${_src}/_eckit_geo.pyx
${_src}/eckit_geo.pxd
${_src}/std.pxd
COMMENT "Cythonizing _eckit_geo.pyx"
VERBATIM
)

Python3_add_library(_eckit_geo MODULE WITH_SOABI
${_eckit_geo_cpp}
${_src}/eckit.cc
)

target_include_directories(_eckit_geo PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src ${_src})
target_link_libraries(_eckit_geo PRIVATE eckit_geo)

install(TARGETS _eckit_geo DESTINATION ${ECKIT_PYTHON_INSTALL_DIR}/eckit/geo COMPONENT python)
install(FILES eckit/src/eckit/geo/__init__.py DESTINATION ${ECKIT_PYTHON_INSTALL_DIR}/eckit/geo COMPONENT python)
endif()
1 change: 1 addition & 0 deletions python/eckit/LICENSE
1 change: 1 addition & 0 deletions python/eckit/VERSION
59 changes: 0 additions & 59 deletions python/eckit/build_chain.sh

This file was deleted.

2 changes: 1 addition & 1 deletion python/eckit/example.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) Copyright 2025- ECMWF.
# (C) Copyright 1996- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
Expand Down
29 changes: 15 additions & 14 deletions python/eckit/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) Copyright 2025- ECMWF.
# (C) Copyright 1996- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
Expand All @@ -9,19 +9,19 @@


[build-system]
requires = ["setuptools>=65", "Cython>=3.0", "wheel"]
requires = ["setuptools>=65", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "eckit"
description = "Don't use this"
requires-python=">=3.9"
description = "Python bindings for eckit"
requires-python = ">=3.9"
license = "Apache-2.0"
license-files = ["../../LICENSE"]
license-files = ["LICENSE"]
authors = [
{ name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "software.support@ecmwf.int" }
]
classifiers=[
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.10",
Expand All @@ -32,14 +32,15 @@ classifiers=[
"Operating System :: MacOS",
"Topic :: Scientific/Engineering",
]
# dependencies = [] # NOTE don't put anything here, use setup.py instead
# NOTE don't list `dependencies` in this file, use setup.py instead
dynamic = ["version", "dependencies"]

[project.scripts]
eckit-geo-share-download = "eckit.tools.geo_share_download:main"

[tool.setuptools]
# NOTE perhaps add a fine-grained exclude so that we eg keep headers only
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html#exclude-package-data
# however, beware of the interaction with data_files -- with `true` it crashes on
# absolute paths etc. Fine-graining such as `tool.setuptools.package-data` may be also
# needed
include-package-data = false
[tool.setuptools.dynamic]
version = {file = "VERSION"}

[tool.setuptools.packages.find]
where = ["src"]
exclude = ["_eckit*"]
8 changes: 0 additions & 8 deletions python/eckit/requirements-devel.txt

This file was deleted.

3 changes: 3 additions & 0 deletions python/eckit/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cython
pyyaml
pytest
Loading
Loading