Skip to content

Commit 6f0b9a2

Browse files
committed
Merge remote-tracking branch 'origin/feature/mtg2_tablesVersion_switch' into feature/mtg2_tablesVersion_switch_chem
2 parents 00cde8d + 522bac7 commit 6f0b9a2

26 files changed

+202
-193
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# (C) Copyright 2024- ECMWF.
2+
#
3+
# This software is licensed under the terms of the Apache Licence Version 2.0
4+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5+
# In applying this licence, ECMWF does not waive the privileges and immunities
6+
# granted to it by virtue of its status as an intergovernmental organisation
7+
# nor does it submit to any jurisdiction.
8+
9+
10+
name: Build Python Wheel for MacOS
11+
12+
on:
13+
# Trigger the workflow manually
14+
workflow_dispatch: ~
15+
16+
# Allow to be called from another workflow
17+
workflow_call: ~
18+
19+
# TODO automation trigger
20+
21+
jobs:
22+
build:
23+
name: Build macos wheel
24+
# TODO enable after all tested
25+
# strategy:
26+
# matrix:
27+
# arch_type: [ARM64, X64]
28+
# runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]
29+
runs-on: [self-hosted, macOS, ARM64 ]
30+
steps:
31+
# TODO convert this to be matrix-friendly for python versions. Note it's a bit tricky since
32+
# we'd ideally not reexecute the compile step multiple times, but it
33+
# (non-essentially) depends on a matrix-based step
34+
# NOTE we dont use action checkout because it doesnt cleanup after itself correctly
35+
- run: |
36+
if [ -z "$(which uv)" ] ; then curl -LsSf https://astral.sh/uv/install.sh | sh ; fi
37+
rm -rf ecbuild wheelmaker
38+
git clone --depth=1 https://github.com/ecmwf/ecbuild ecbuild
39+
# git clone --depth=1 --branch="wheelmaker" https://github.com/ecmwf/ci-utils wheelmaker # TODO use token here to get rid of the checkout action below
40+
- uses: actions/checkout@v4
41+
with:
42+
repository: ecmwf/ci-utils
43+
ref: develop
44+
path: ci-utils
45+
token: ${{ secrets.GH_REPO_READ_TOKEN }}
46+
- run: rm -rf proj && git clone --depth=1 --branch="${GITHUB_REF#refs/heads/}" https://github.com/$GITHUB_REPOSITORY proj
47+
- run: |
48+
cd proj && $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/prepare_deps.sh ./python_wrapper/buildconfig 3.11
49+
- run: |
50+
cd proj
51+
if [[ -f ./python_wrapper/pre-compile.sh ]] ; then ./python_wrapper/pre-compile.sh ; fi
52+
PATH="$PATH:$GITHUB_WORKSPACE/ecbuild/bin/" $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/compile.sh ./python_wrapper/buildconfig
53+
- run: |
54+
cd proj
55+
rm -rf /tmp/buildvenv && uv python install python3.11 && uv venv --python python3.11 /tmp/buildvenv && source /tmp/buildvenv/bin/activate && uv pip install build twine
56+
PYTHONPATH=$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/wheel-linux.sh ./python_wrapper/buildconfig 3.11
57+
if [[ -f ./python_wrapper/post-build.sh ]] ; then ./python_wrapper/post-build.sh ; fi
58+
$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/test-wheel.sh ./python_wrapper/buildconfig 3.11
59+
$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/upload-pypi.sh ./python_wrapper/buildconfig
60+
env:
61+
TWINE_USERNAME: __token__
62+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
63+
# NOTE temporary thing until all the mess gets cleared
64+
- run: rm -rf ./* ./.git ./.github

definitions/grib2/boot.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ transient missingValue = 9999;
3131
constant ieeeFloats = 1 : edition_specific;
3232
constant isHindcast = 0;
3333

34-
# Set MTG2 defaults
35-
constant tablesVersionMTG2Switch=33: hidden;
36-
constant MTG2SwitchDefault = 1;
3734

3835
include "grib2/section.0.def"
3936

definitions/grib2/local/ecmf/section2_extras.def

Lines changed: 0 additions & 62 deletions
This file was deleted.

definitions/grib2/localConcepts/s2s/MTG2SwitchConcept.def

Lines changed: 0 additions & 2 deletions
This file was deleted.

definitions/grib2/localConcepts/tigge/MTG2SwitchConcept.def

Lines changed: 0 additions & 2 deletions
This file was deleted.

definitions/grib2/localConcepts/uerra/MTG2SwitchConcept.def

Lines changed: 0 additions & 2 deletions
This file was deleted.

definitions/grib2/parameters.def

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,15 @@
11
# (C) Copyright 2005- ECMWF.
22

33
transient dummyc=0: hidden;
4-
# Evaluate MTG2Switch concept.
5-
# Default is 1 unless changed by centre or pseudocentre, set in boot.def.
6-
# To be discussed. This means that all centres are default post-MTG2 unless entry is added in concept.
74

8-
concept MTG2Switch(MTG2SwitchDefault, "MTG2SwitchConcept.def", conceptsDir2,conceptsDir1): no_copy, read_only, long_type;
5+
# With value of the switch defined in section.4.def, we read the corresponding def files. This works as follows:
6+
#  Pre-MTG2 ( MTG2Switch=0 ): static def files [concept].[tablesVersionMTG2Switch].def
7+
# Else ( MTG2Switch!=0 ): default def files [concept].def. Ensures continuity of "status quo".
98

10-
# If MTG2Switch is 0 (pre-MTG2) we need to look at pre-MTG2 definitions, tableVersion defined in boot.def.
11-
# Otherwise look at new definitions.
12-
13-
if ( MTG2Switch == 0 ) {
14-
15-
constant paramIdFilename = "paramId.[tablesVersionMTG2Switch].def" : hidden ;
16-
constant shortNameFilename = "shortName.[tablesVersionMTG2Switch].def" : hidden ;
17-
constant unitsFilename = "units.[tablesVersionMTG2Switch].def" : hidden ;
18-
constant nameFilename = "name.[tablesVersionMTG2Switch].def" : hidden ;
19-
20-
# All other cases other than pre-MTG2 fall into default parameter files
21-
} else {
22-
23-
constant paramIdFilename = "paramId.def" : hidden ;
24-
constant shortNameFilename = "shortName.def" : hidden ;
25-
constant unitsFilename = "units.def" : hidden ;
26-
constant nameFilename = "name.def" : hidden ;
27-
28-
}
29-
30-
# meta paramIdFilename g2_param_concept_filename("paramId", MTG2Switch, tablesVersionMTG2Switch, datasetForLocal): hidden;
31-
# meta shortNameFilename g2_param_concept_filename("shortName", MTG2Switch, tablesVersionMTG2Switch, datasetForLocal): hidden;
32-
# meta unitsFilename g2_param_concept_filename("units", MTG2Switch, tablesVersionMTG2Switch, datasetForLocal): hidden;
33-
# meta nameFilename g2_param_concept_filename("name", MTG2Switch, tablesVersionMTG2Switch, datasetForLocal): hidden;
9+
meta paramIdFilename g2_param_concept_filename("paramId", MTG2Switch, tablesVersionMTG2Switch, datasetForLocal): hidden;
10+
meta shortNameFilename g2_param_concept_filename("shortName", MTG2Switch, tablesVersionMTG2Switch, datasetForLocal): hidden;
11+
meta unitsFilename g2_param_concept_filename("units", MTG2Switch, tablesVersionMTG2Switch, datasetForLocal): hidden;
12+
meta nameFilename g2_param_concept_filename("name", MTG2Switch, tablesVersionMTG2Switch, datasetForLocal): hidden;
3413

3514
# Now deal with chemical parameter split, pre and post MTG2
3615
if (defined(MTG2Switch) and MTG2Switch == 2) {
@@ -65,7 +44,7 @@ concept nameLegacyECMF(defaultName,"name.legacy.def",conceptsMasterDir,conceptsL
6544
concept nameECMF(nameLegacyECMF,nameFilename,conceptsMasterDir,conceptsLocalDirECMF): no_copy;
6645
concept name(nameECMF,nameFilename,conceptsDir2,conceptsDir1): no_copy,dump;
6746

68-
# cfName does not have pre and post MTG2 switch
47+
# cfName does not have pre and post MTG2 change in definition files
6948

7049
concept cfNameLegacyECMF(defaultShortName,"cfName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden;
7150
concept cfNameECMF(cfNameLegacyECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy;

definitions/grib2/products_crra.def

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,3 @@ if (marsStream is "dame") {
141141
unalias mars.time;
142142
unalias mars.step;
143143
}
144-
# MTG2 support given lack of local section
145-
# This comes after the paramId is already decided, so doesn't work.
146-
# if (tablesVersion <= tablesVersionMTG2Switch) {
147-
# # Pre-MTG2
148-
# constant MTG2SwitchDefault = 0;
149-
# } else {
150-
# # All other cases we are post-MTG2
151-
# constant MTG2SwitchDefault = 1;
152-
# }

definitions/grib2/products_s2s.def

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,3 @@ if (is_ocean3d_param) {
109109
alias mars.levtype = oceanLevName;
110110
unalias mars.levelist;
111111
}
112-
113-
# MTG2 support given lack of local section
114-
# This comes after the paramId is already decided, so doesn't work.
115-
# if (tablesVersion <= tablesVersionMTG2Switch) {
116-
# # Pre-MTG2
117-
# constant MTG2SwitchDefault = 0;
118-
# } else {
119-
# # All other cases we are post-MTG2
120-
# constant MTG2SwitchDefault = 1;
121-
# }

definitions/grib2/products_tigge.def

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,3 @@ concept marsStream(unknown) {
8181

8282
alias mars.stream = marsStream;
8383
alias mars.type = marsType;
84-
85-
# MTG2 support given lack of local section
86-
# This comes after the paramId is already decided, so doesn't work.
87-
# if (tablesVersion <= tablesVersionMTG2Switch) {
88-
# # Pre-MTG2
89-
# constant MTG2SwitchDefault = 0;
90-
# } else {
91-
# # All other cases we are post-MTG2
92-
# constant MTG2SwitchDefault = 1;
93-
# }

0 commit comments

Comments
 (0)