Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ectrans4py tests rebased #199

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e2e73a4
equivalent to ectrans in CY48T3_mrg48R1.02:contrib/
AlexandreMary Oct 11, 2022
5ba37a2
Variable LALL_FFTW to perform fftw transforms in one bunch of all fi…
RyadElKhatibMF Nov 13, 2023
ae51a5c
phase with CY49R1
AlexandreMary Apr 8, 2024
196070e
Added LAM transforms and LAM benchmark.
ddegrauwe May 30, 2024
cae92ee
cleaned installation a bit: only one library (trans) instead of separ…
ddegrauwe May 30, 2024
98d0037
removed reference to etrans from trans/CMakeLists.txt
ddegrauwe Jun 10, 2024
0ed874b
moved ellips to fiat
ddegrauwe Sep 3, 2024
ba837f4
add ectrans python interface ectrans4py
walidchikhi Oct 19, 2024
c12ef84
ectrans4py version is same as ectrans
AlexandreMary Oct 30, 2024
5032eb9
cleaner python package
AlexandreMary Oct 30, 2024
ae6d7e0
Optional PROGRAMS feature
AlexandreMary Oct 30, 2024
6a8de09
Label 1.2.50 = 1.2.0+@CY50
AlexandreMary Oct 30, 2024
417bc1c
Merge branch 'to_CY50_fixed' into ACCORD-NWP/to_CY50_rebased
samhatfield Nov 13, 2024
f01ecf9
fixed ETRANS=ON: (i) follow single/double precision mechanism from tr…
ddegrauwe Dec 3, 2024
b39dc34
Added LAM test
ddegrauwe Dec 3, 2024
f821b09
added license information to etrans sources
ddegrauwe Dec 3, 2024
e297846
removed fft992 sources
ddegrauwe Dec 5, 2024
048527f
removed PROGRAMS option (always true)
ddegrauwe Dec 5, 2024
038023b
Merge branch 'develop' into ACCORD-NWP/to_CY50_rebased
samhatfield Dec 5, 2024
73111ab
Touch up etrans tests
samhatfield Dec 5, 2024
5970b5f
fix extension of ectrans4py/gp2sp_lam4py
AlexandreMary Dec 20, 2024
57b660d
clean MANIFEST.in
AlexandreMary Dec 20, 2024
7f0a62d
label 1.2.51
AlexandreMary Dec 20, 2024
8ee9200
add tests for ectrans4py
AlexandreMary Jan 22, 2025
2e145ad
add sp2gp/gp2sp tests
AlexandreMary Jan 23, 2025
fbbe3ed
add info about ectrans4py in README
AlexandreMary Jan 23, 2025
2cdfb1e
adapt compilectrans4py build: fftw and omp
AlexandreMary Jan 27, 2025
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ build/*
install/*
env.sh
*.DS_Store

*.py[co~]
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ ecbuild_add_option( FEATURE GPU_STATIC
DEFAULT ${GPU_STATIC_DEFAULT}
DESCRIPTION "Compile GPU library as static library")

ecbuild_add_option( FEATURE ETRANS
DEFAULT OFF
DESCRIPTION "Include Limited-Area-Model Transforms" )

ecbuild_add_option( FEATURE ECTRANS4PY
DEFAULT OFF
CONDITION HAVE_ETRANS
DESCRIPTION "Compile ectrans4py interface routines for python binding w/ ctypesForFortran" )


ectrans_find_lapack()

ecbuild_add_option( FEATURE TESTS
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include cmake
exclude MANIFEST.in
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,28 @@ The benchmark drivers are found in the bin directory.
A brief description of available command-line arguments can be obtained with e.g.
ectrans-benchmark-cpu-sp --help

Building `ectrans4py`
---------------------

The python wheel can be built from the root of the project, assuming above-mentioned variables are defined (`fiat_ROOT` etc...):
```
python -m build --wheel
```
and then:
```
python -m auditwheel
```
The built python wheel is then to be found in directory `wheelhouse/` and can be locally installed by pip:
```
pip install wheelhouse/ectrans4py-<x.y.z>(...).whl
```
The `_skbuild` and `dist` directories can be deleted.

Tests can be run from `tests/test_ectrans4py/`:
```
python -m pytest
```

Reporting Bugs
==============

Expand Down
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[project]
name = "ectrans4py"
dynamic = ["version"]
description = "ECTRANS interface for Python"
readme = "README.md"
requires-python = ">=3.10"
dependencies=["numpy", "ctypesForFortran<2.0.0"]
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Operating System :: Unix',
]

[build-system]
requires = ["setuptools", "wheel", "scikit-build"]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
version = {attr = "ectrans4py.__version__"}
26 changes: 26 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os
import ast
from skbuild import setup

_version_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "VERSION")
with open(_version_file, "r") as f:
__version__ = f.read().strip()

setup(
name="ectrans4py",
version=__version__,
packages=['ectrans4py'],
cmake_minimum_required_version="3.13",
cmake_args=[
'-DENABLE_ETRANS=ON',
'-DENABLE_ECTRANS4PY=ON',
'-DENABLE_SINGLE_PRECISION=OFF',
'-DENABLE_PROGRAMS=OFF',
'-DENABLE_OMP=ON',
'-DFFTW_USE_STATIC_LIBS=ON',
],
package_dir={"": "src"},
cmake_install_dir="src/ectrans4py",
setup_requires=["scikit-build", "setuptools"],
install_requires=["numpy", "ctypesforfortran==1.1.3"],
)
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

add_subdirectory( trans )
add_subdirectory( programs )

if( HAVE_TRANSI )
add_subdirectory(transi)
endif()
if( HAVE_ETRANS )
add_subdirectory(etrans)
endif()
if(HAVE_ECTRANS4PY)
add_subdirectory(ectrans4py)
endif()
20 changes: 20 additions & 0 deletions src/ectrans4py/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if(HAVE_ETRANS)
# (using CMAKE_CURRENT_SOURCE_DIR is necessary because sources are in a different directory than the target library (trans_${prec}))
ecbuild_list_add_pattern(
LIST ectrans4py_src
GLOB ${CMAKE_CURRENT_SOURCE_DIR}/*.F90
QUIET
)

set(HAVE_dp ${HAVE_DOUBLE_PRECISION})
set(prec dp)

if(HAVE_${prec})
# Add sources
target_sources(trans_${prec} PRIVATE ${ectrans4py_src})
endif()

else()
ecbuild_critical("To activate the ectrans Python interface, you must enable the ETRANS option.")
endif()

Loading
Loading