Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
e412eb6
Merge pull request #324 from ecmwf/develop
mathleur Feb 13, 2025
b81d681
Merge pull request #326 from ecmwf/develop
mathleur Feb 14, 2025
78537b0
Merge pull request #331 from ecmwf/develop
mathleur Feb 24, 2025
6cf72a1
Merge pull request #333 from ecmwf/develop
mathleur Feb 24, 2025
3924d06
Merge pull request #335 from ecmwf/develop
awarde96 Feb 25, 2025
a508151
Fix examples index
awarde96 Feb 25, 2025
95c35a4
Fix link
awarde96 Feb 25, 2025
3251c05
Merge pull request #337 from ecmwf/docs/fix_link
mathleur Feb 25, 2025
1cd8ed7
Merge pull request #339 from ecmwf/develop
mathleur Mar 3, 2025
7a12d8d
Merge pull request #342 from ecmwf/develop
mathleur Mar 3, 2025
2dab321
Merge pull request #344 from ecmwf/develop
mathleur Mar 3, 2025
03aa532
Merge pull request #346 from ecmwf/develop
mathleur Mar 4, 2025
00c2610
Merge pull request #350 from ecmwf/develop
mathleur Mar 11, 2025
5172832
Merge pull request #352 from ecmwf/develop
mathleur Mar 17, 2025
4df2f14
Merge pull request #354 from ecmwf/develop
mathleur Mar 17, 2025
5988ddc
Merge pull request #358 from ecmwf/develop
mathleur Mar 17, 2025
79f3c73
Merge pull request #363 from ecmwf/develop
mathleur Mar 19, 2025
f47211e
do not import in init for mapper types
mathleur Mar 26, 2025
07d1c06
remove caching of healpix nested grid
mathleur Mar 27, 2025
c3b22b7
update version and black
mathleur Mar 27, 2025
c3055f2
Merge pull request #365 from ecmwf/feature/remove_healpix_nested_grid…
mathleur Mar 27, 2025
728f58c
Merge pull request #364 from ecmwf/feature/remove_files_from_init
mathleur Mar 27, 2025
0dfac36
Merge pull request #366 from ecmwf/develop
mathleur Mar 27, 2025
fca670b
add maturity badge
mathleur Mar 27, 2025
39ac61e
Merge pull request #368 from ecmwf/main
mathleur Mar 27, 2025
c295375
Merge pull request #367 from ecmwf/feature/maturity_level_badge
mathleur Mar 27, 2025
6d720f7
remove some expensive computations
mathleur Mar 27, 2025
9db9c0d
make ring_to_nested a numpy operation
mathleur Mar 27, 2025
764366b
clean up
mathleur Mar 27, 2025
d8c8c21
make work on fdb
mathleur Mar 27, 2025
e0510fb
upgrade version
mathleur Mar 27, 2025
02d45d6
Merge pull request #369 from ecmwf/feature/improve_healpix_nested
mathleur Mar 27, 2025
30632b4
fix bug
mathleur Apr 1, 2025
f104d0d
Merge pull request #371 from ecmwf/feature/fix_bug_
mathleur Apr 1, 2025
55830fb
update version
mathleur Apr 1, 2025
9c75065
Merge pull request #372 from ecmwf/feature/update_v
mathleur Apr 1, 2025
772fe82
Update gribjump interface to use iterator
ChrisspyB Apr 8, 2025
29c0a1b
Extend one range at a time
ChrisspyB Apr 8, 2025
19f8d1c
WIP
mathleur Apr 9, 2025
c126bc3
Merge pull request #375 from ecmwf/feature/gribjump-iterator
mathleur Apr 9, 2025
6a61a42
update version
mathleur Apr 9, 2025
f4cf196
add pytest fixtures to add fdb data
mathleur Apr 14, 2025
1ca8564
isort
mathleur Apr 14, 2025
2e11478
black
mathleur Apr 14, 2025
5a0d809
add test requirements
mathleur Apr 14, 2025
05e4622
try to install pygribjump
mathleur Apr 14, 2025
39b02de
try to install pygribjump
mathleur Apr 14, 2025
98f7457
add downstream ci
mathleur Apr 15, 2025
18a8c80
add hpc github ci config and fix branch of downstream ci
mathleur Apr 15, 2025
b529204
fix path to downstream ci
mathleur Apr 15, 2025
cc2e11b
Merge pull request #376 from ecmwf/feature/upadte_version
mathleur Apr 28, 2025
210e161
update ubuntu version in ci to latest
mathleur Apr 28, 2025
45a2f49
finish changing to ubuntu latest in ci
mathleur Apr 28, 2025
0922a91
try to modify ecbuild build options
mathleur Apr 28, 2025
e7e3e81
use ecmwf instead of ecmwf-actions
mathleur Apr 28, 2025
781d042
add specific ubuntu version
mathleur Apr 28, 2025
7858115
update ci matrix
mathleur Apr 28, 2025
6477f9d
add new matrix for ci
mathleur Apr 28, 2025
c894944
change to old ecbuild building
mathleur Apr 28, 2025
ef74066
remove setup action and ubuntu-24.04 from matrix and add setuptools b…
mathleur Apr 28, 2025
a522c47
remove setup action
mathleur Apr 28, 2025
4c5b379
clean up ci
mathleur Apr 28, 2025
fd0c9a3
Merge pull request #387 from ecmwf/feature/update_ci
mathleur Apr 28, 2025
75e9c32
update hash for reduced_ll 3601 grid
mathleur May 14, 2025
cd8f9b8
Merge pull request #391 from ecmwf/feature/fix_reduced_ll_grid_hash
mathleur May 14, 2025
22dfdfe
Pin libaec to v1.1.3
Ozaq Jun 16, 2025
51d3f08
Merge pull request #397 from ecmwf/Ozaq-patch-1
simondsmart Jun 16, 2025
cf57c19
update gitignore
mathleur Jun 23, 2025
f935f1f
merge develop
mathleur Jun 23, 2025
aacc380
fix libaec to working tag and add conflator dependency
mathleur Jun 23, 2025
8133cb1
fix conflator branch to main
mathleur Jun 23, 2025
d83a80a
remove conflator from ci-config
mathleur Jun 23, 2025
4d18bec
add requests to requirements for tests
mathleur Jun 23, 2025
5fef3eb
add qa
mathleur Jun 23, 2025
0740050
remove qa
mathleur Jun 23, 2025
a785c49
remove hpc downstream ci
mathleur Jun 23, 2025
da67fde
add qa and deployment on release
mathleur Jun 23, 2025
9c1425b
merge develop
mathleur Jun 23, 2025
54af6e1
add HTTPError to conftest
mathleur Jun 23, 2025
fcbb964
add fdb creation to pytest
mathleur Jun 23, 2025
890b6b5
change scope of fdb_path
mathleur Jun 23, 2025
ad0cf97
change all fixtures to function scope
mathleur Jun 23, 2025
22a14f1
add debug of fdb axes
mathleur Jun 23, 2025
6cc916d
add new data file to test fdb
mathleur Jun 23, 2025
1c2b183
black
mathleur Jun 23, 2025
eb10d9a
clean up
mathleur Jun 23, 2025
e968f54
turn on more fdb tests
mathleur Jun 23, 2025
c68bc12
disable patch coverage
mathleur Jun 24, 2025
17c26ce
turn on fdb tests
mathleur Jun 25, 2025
37788ed
change fdb test
mathleur Jun 25, 2025
0ae6633
fix more fdb tests
mathleur Jul 3, 2025
420ebf6
fix more fdb tests
mathleur Jul 3, 2025
af67b6d
fix more fdb tests
mathleur Jul 3, 2025
9885d5d
fix more tests
mathleur Jul 3, 2025
d8e751c
make tests work
mathleur Jul 7, 2025
25a2360
WIP: fix tests in CI
mathleur Jul 7, 2025
5c9f2ab
WIP: fix tests in CI
mathleur Jul 7, 2025
c2c9df6
WIP: fix fdb tests
mathleur Jul 7, 2025
9015cb3
WIP: fix tests
mathleur Jul 7, 2025
f29ec9b
clean up
mathleur Jul 7, 2025
eb0db19
black
mathleur Jul 7, 2025
0e9390a
clean up ci file
mathleur Jul 7, 2025
8237991
Merge pull request #381 from ecmwf/fix/add_fdb_test_data
mathleur Jul 7, 2025
b76a9dd
remove specific ci branch
mathleur Jul 7, 2025
77ce80f
point to downstream ci main branch
mathleur Jul 7, 2025
e884516
Merge pull request #400 from ecmwf/feature/update_ci_branch
mathleur Jul 7, 2025
7d04753
WIP: try to integrate with new qubed develop
mathleur Jul 15, 2025
dd540d0
add downstream ci hpc
mathleur Jul 16, 2025
7c86b92
try to add test cmds to hpc ci
mathleur Jul 16, 2025
0ff2252
Test ci fixes on hpc
iainrussell Jul 16, 2025
5d01635
Add hpc-specific pytest command
iainrussell Jul 16, 2025
16b86b6
update branch of ci
mathleur Jul 16, 2025
4dce137
Merge branch 'feature/hpc_ci' into feature/hpc_ci_2
mathleur Jul 16, 2025
770fc1f
Merge pull request #406 from ecmwf/feature/hpc_ci_2
mathleur Jul 16, 2025
7a1d63f
change downstream ci branch to main
mathleur Jul 16, 2025
1645e9a
Merge pull request #405 from ecmwf/feature/hpc_ci
mathleur Jul 17, 2025
d9a4791
WIP: add right metadata to constructed qube and flatten metadata at g…
mathleur Jul 22, 2025
522d205
Merge branch 'feature/recursive_qubed_datacube_construction' into fea…
mathleur Jul 22, 2025
77dfe9f
Merge pull request #411 from ecmwf/feature/recursive_qubed_w_types_test
mathleur Jul 22, 2025
7d5b281
merge with new qubed develop
mathleur Jul 22, 2025
27d73e6
WIP: collect right metadata in return qube
mathleur Jul 22, 2025
a684046
keep right metadata during qubed slicing
mathleur Jul 23, 2025
036f44d
finish adding metadata for gj and pass it all the way to gj
mathleur Jul 23, 2025
1df4c84
add metadata as gj expects in qubed backend
mathleur Jul 31, 2025
4d21e3f
clean up
mathleur Jul 31, 2025
2fd4306
add result to Qube metadata
mathleur Jul 31, 2025
ee37224
flatten metadata to give to gj
mathleur Jul 31, 2025
394240b
handle when there are no sliced polytopes
mathleur Jul 31, 2025
a07212a
fix bug
mathleur Aug 4, 2025
35d3286
clean up
mathleur Aug 4, 2025
097a674
WIP: clean up
mathleur Aug 4, 2025
b1bbf51
change to sites.ecmwf instead of nexus
mathleur Aug 4, 2025
c32c9c5
black
mathleur Aug 4, 2025
077e9ce
Merge pull request #412 from ecmwf/feature/sites_data
mathleur Aug 4, 2025
96605ea
avoid deepcopies
mathleur Aug 4, 2025
acc74c3
consistent metadata idxs
mathleur Aug 4, 2025
d09d016
optimise metadata indexing
mathleur Aug 4, 2025
29d5c13
fix compression of axes with qube slicer
mathleur Aug 4, 2025
a50cf2f
WIP:optimise
mathleur Aug 5, 2025
003815b
fix polytope-gj interface for qubed backend
mathleur Aug 6, 2025
4221363
think about refactoring gj/qube backend
mathleur Aug 6, 2025
601ade3
merge with develop
mathleur Aug 6, 2025
243d4f9
fix bug
mathleur Aug 7, 2025
2212768
clean up
mathleur Aug 7, 2025
3996212
Merge pull request #413 from ecmwf/feature/qubed_tree_metadata_merged…
mathleur Aug 8, 2025
6c4f306
Merge pull request #414 from ecmwf/feature/optimised_qubed_backend_w_…
mathleur Aug 8, 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
13 changes: 13 additions & 0 deletions .github/ci-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dependencies: |
ecmwf/ecbuild
MathisRosenhauer/libaec@refs/tags/v1.1.3
ecmwf/eccodes
ecmwf/eckit@develop
ecmwf/metkit
ecmwf/fdb
ecmwf/gribjump
dependency_cmake_options: |
ecmwf/gribjump: "-DENABLE_FDB_BUILD_TOOLS=ON"
dependency_branch: develop
parallelism_factor: 8
self_build: false
21 changes: 21 additions & 0 deletions .github/ci-hpc-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
build:
python: "3.10"
modules:
- ninja
- aec
dependencies:
- ecmwf/ecbuild@develop
- ecmwf/eccodes@develop
- ecmwf/eckit@develop
- ecmwf/metkit@develop
- ecmwf/fdb@develop
- ecmwf/gribjump@develop
dependency_cmake_options:
- "ecmwf/gribjump: '-DENABLE_FDB_BUILD_TOOLS=ON'"
- "ecmwf/fdb: '-DENABLE_LUSTRE=OFF'"
parallel: 64
env:
- ECCODES_SAMPLES_PATH=$ECCODES_DIR/share/eccodes/samples
- ECCODES_DEFINITION_PATH=$ECCODES_DIR/share/eccodes/definitions
pytest_cmd: |
python -m pytest -m 'not fdb' tests --cov=./ --cov-report=xml
11 changes: 11 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: cd

on:
push:
tags:
- '**'

jobs:
deploy:
uses: ecmwf-actions/reusable-workflows/.github/workflows/create-package.yml@v2
secrets: inherit
156 changes: 28 additions & 128 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,145 +1,45 @@
name: ci

on:
# Trigger the workflow on push to master or develop, except tag creation
push:
branches:
- 'main'
- 'develop'
- "main"
- "develop"
tags-ignore:
- "**"

# Trigger the workflow on pull request
pull_request: ~

# Trigger the workflow manually
workflow_dispatch: ~

# Trigger after public PR approved for CI
pull_request_target:
types: [labeled]
release:
types: [created]
jobs:
qa:
name: qa
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}

- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install black flake8 isort
- name: Check isort
run: isort --check .

- name: Check black
run: black --check .

- name: Check flake8
run: flake8 .
setup:
name: setup
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
inputs: ${{ steps.prepare-inputs.outputs.inputs }}
inputs-for-ubuntu: ${{ steps.prepare-inputs.outputs.inputs-for-ubuntu }}
steps:
- name: Set Matrix
id: set-matrix
shell: bash -eux {0}
run: |
MATRIX=$(cat << 'EOS'
name:
- gnu-11@ubuntu-22.04
- clang-14@ubuntu-22.04
include:
- name: gnu-11@ubuntu-22.04
os: ubuntu-22.04
compiler: gnu-11
compiler_cc: gcc-11
compiler_cxx: g++-11
compiler_fc: gfortran-11
- name: clang-14@ubuntu-22.04
os: ubuntu-22.04
compiler: clang-14
compiler_cc: clang-14
compiler_cxx: clang++-14
compiler_fc: gfortran-11
# Xcode compiler requires empty environment variables, so we pass null (~) here
EOS
)
SKIP_MATRIX_JOBS=$(cat << 'EOS'
${{ inputs.skip_matrix_jobs }}
EOS
)
SELECT_NAME_COND="1 != 1"
SELECT_INCLUDE_COND="1 != 1"
for skip_job in $SKIP_MATRIX_JOBS; do SELECT_NAME_COND="$SELECT_NAME_COND or . == \"$skip_job\""; SELECT_INCLUDE_COND="$SELECT_INCLUDE_COND or .name == \"$skip_job\""; done
echo matrix=$(echo "$MATRIX" | yq eval "del(.name[] | select($SELECT_NAME_COND)) | del(.include[] | select($SELECT_INCLUDE_COND))" --output-format json --indent 0 -) >> $GITHUB_OUTPUT
- name: Prepare build-package Inputs
id: prepare-inputs
shell: bash -eux {0}
run: |
echo inputs=$(echo "${{ inputs.build_package_inputs || '{}' }}" | yq eval '.' --output-format json --indent 0 -) >> $GITHUB_OUTPUT
echo inputs-for-ubuntu=$(echo "${{ inputs.build_package_inputs || '{}' }}" | yq eval '. * {"os":"ubuntu-20.04","compiler":"gnu-10","compiler_cc":"gcc-10","compiler_cxx":"g++-10","compiler_fc":"gfortran-10"}' --output-format json --indent 0 -) >> $GITHUB_OUTPUT
test:
name: test
needs:
- qa
- setup
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install eccodes and Dependencies
id: install-dependencies
uses: ecmwf-actions/build-package@v2
with:
self_build: false
dependencies: |
ecmwf/ecbuild@develop
MathisRosenhauer/libaec@master
ecmwf/eccodes@develop

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}

- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov
python -m pip install -r requirements.txt
python -m pip install -r ./tests/requirements_test.txt

- name: Verify Source Distribution
shell: bash -eux {0}
run: |
python setup.py sdist
python -m pip install dist/*
- name: Run Tests with Repository Code
env:
LD_LIBRARY_PATH: ${{ steps.install-dependencies.outputs.lib_path }}
shell: bash -eux {0}
run: |
DYLD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} python -m pytest -m "not fdb" tests --cov=./ --cov-report=xml
python -m coverage report
jobs:
# Run CI including downstream packages on self-hosted runners
downstream-ci:
name: downstream-ci
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf/downstream-ci/.github/workflows/downstream-ci.yml@main
with:
polytope: ecmwf/polytope@${{ github.event.pull_request.head.sha || github.sha }}
codecov_upload: true
python_qa: true
secrets: inherit

downstream-ci-hpc:
name: downstream-ci-hpc
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
with:
polytope: ecmwf/polytope@${{ github.event.pull_request.head.sha || github.sha }}
secrets: inherit

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.xml
deploy:
needs: test
if: ${{ github.event_name == 'release' }}
name: Upload to Pypi
runs-on: ubuntu-latest
Expand All @@ -159,4 +59,4 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload dist/*
twine upload dist/*
10 changes: 10 additions & 0 deletions .github/workflows/label-public-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Manage labels of pull requests that originate from forks
name: label-public-pr

on:
pull_request_target:
types: [opened, synchronize]

jobs:
label:
uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ polytope_feature/_version.py
**.lock
**/target
**/*venv*/
test_w_qubed
test_w_qubed
performance_plots_qubed
_version.py
*.DS_Store
*.nc
8 changes: 7 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ ignore:
- "**/test*"
- "**/pb2*"
- "**/fdb*" # ignore fdb backend which we can't test in CI yet
- "polytope/datacube/backends/fdb.py" # ignore fdb backend which we can't test in CI yet
- "polytope/datacube/backends/fdb.py" # ignore fdb backend which we can't test in CI yet

coverage:
status:
patch:
default:
enabled: false # disables patch check
10 changes: 5 additions & 5 deletions docs/Service/Examples/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
## Open Data

* <a href="../OpenData/od_timeseries_example">Timeseries</a>
* <a href="../OpenData/od_polygon_example">Timeseries</a>
* <a href="../OpenData/od_vertical_profile_example">Timeseries</a>
* <a href="../OpenData/od_boundingbox_example">Timeseries</a>
* <a href="../OpenData/od_trajectory_example">Timeseries</a>
* <a href="../OpenData/od_country_example">Timeseries</a>
* <a href="../OpenData/od_polygon_example">Polygon</a>
* <a href="../OpenData/od_vertical_profile_example">Vertical Profile</a>
* <a href="../OpenData/od_boundingbox_example">Bounding Box</a>
* <a href="../OpenData/od_trajectory_example">Trajectory</a>
* <a href="../OpenData/od_country_example">Country Cut-Out</a>

For examples of Polytope Feature Extraction on Destination Earth Digital Twin Data please visit the following Github Repo: https://github.com/destination-earth-digital-twins/polytope-examples

Expand Down
19 changes: 14 additions & 5 deletions polytope_feature/datacube/backends/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def get_indices(self, path: DatacubePath, axis, lower, upper, method=None):
e.g. returns integer discrete points between two floats
"""
path = self.fit_path(path)
print(path)
indexes = axis.find_indexes(path, self)

idx_between = axis.find_indices_between(indexes, lower, upper, self, method)
Expand All @@ -170,7 +169,15 @@ def remap_path(self, path: DatacubePath):
return path

@staticmethod
def create(datacube, config={}, axis_options={}, compressed_axes_options=[], alternative_axes=[], datacube_axes={}, context=None):
def create(
datacube,
config={},
axis_options={},
compressed_axes_options=[],
alternative_axes=[],
datacube_axes={},
context=None,
):
# TODO: get the configs as None for pre-determined value and change them to empty dictionary inside the function
if type(datacube).__name__ == "DataArray":
from .xarray import XArrayDatacube
Expand All @@ -185,13 +192,15 @@ def create(datacube, config={}, axis_options={}, compressed_axes_options=[], alt
)
return fdbdatacube
if type(datacube).__name__ == "Qube":
from .qubed import QubedDatacube
from ..datacube_axis import _str_to_axis
from .qubed import QubedDatacube

actual_datacube_axes = {}
for key, value in datacube_axes.items():
actual_datacube_axes[key] = _str_to_axis[value]
qubed_datacube = QubedDatacube(datacube, actual_datacube_axes,
config, axis_options, compressed_axes_options, alternative_axes, context)
qubed_datacube = QubedDatacube(
datacube, actual_datacube_axes, config, axis_options, compressed_axes_options, alternative_axes, context
)
return qubed_datacube

def check_branching_axes(self, request):
Expand Down
Loading
Loading