Skip to content

Commit b9bc6a9

Browse files
authored
General Improvements + bug fixes + multi scale meshing support for global meshes (#87)
feat(mesh,geodata): CRS-safe global+regional multiscale meshing & shoreline Region API • Add synthetic georef fallback for ungeoreferenced DEM rasters and normalize DEM full-read orientation • Centralize CRS/stereo validation, drop brittle CRS set() checks, and harden multiscale SDF (non-finite guards, KDTree fixes) • Align sizing grids across mixed CRS via CRS-aware Grid.reproject_to/compute_minimum; stabilize _compute_forces and min_edge_length from positive finite values • Rewrite bathymetric_gradient_sizing_function to operate on DEM lattice in physical units with bounds, coarsening, and geographic meter↔degree scaling • Document and test global+regional multiscale workflow (stereo/global-first semantics, bbox containment across projections, logging/plotting, e2e Australia refinement test) • Introduce Region-first shoreline API with CRS autodetect/inference, improved error guidance, and Region-based DEM initialization • Replace inpoly-python with Cython inpoly backend, relax boundary consistency checks, and update CI/tox/flake8 configuration
1 parent 478fe78 commit b9bc6a9

36 files changed

+34297
-633
lines changed

.github/workflows/testing.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/setup-python@v2
1414
with:
15-
python-version: "3.9"
15+
python-version: "3.12"
1616
- uses: actions/checkout@v2
1717
- name: Lint with flake8
1818
run: |
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
python-version: [ 3.8, 3.9, '3.10', '3.11']
30+
python-version: ['3.10','3.11','3.12','3.13']
3131
steps:
3232
- uses: actions/checkout@v2
3333
- name: Set up Python ${{ matrix.python-version }}
@@ -44,11 +44,36 @@ jobs:
4444
run: |
4545
sudo apt install -y libopenmpi3 libopenmpi-dev openmpi-bin
4646
sudo apt install -y libhdf5-dev
47-
- name: pre install numpy (for inpoly)
47+
- name: Install Python build dependencies
4848
run: |
49-
pip install numpy
49+
python -m pip install --upgrade pip
50+
python -m pip install Cython numpy
51+
- name: Verify Cython inpoly kernel is available
52+
env:
53+
OCEANMESH_INPOLY_ACCEL: "1"
54+
run: |
55+
python -m pip install -e .
56+
python - << 'PY'
57+
import os, importlib
58+
from oceanmesh.geometry import point_in_polygon as pip
59+
60+
# Ensure we use the default acceleration behaviour
61+
os.environ.pop("OCEANMESH_INPOLY_METHOD", None)
62+
os.environ["OCEANMESH_INPOLY_ACCEL"] = "1"
63+
pip = importlib.reload(pip)
64+
65+
if not getattr(pip, "_COMPILED_KERNEL_AVAILABLE", False):
66+
raise SystemExit("Cython inpoly2 kernel not available in CI environment")
67+
68+
print("_COMPILED_KERNEL_AVAILABLE =", pip._COMPILED_KERNEL_AVAILABLE)
69+
from oceanmesh.geometry.point_in_polygon_ import inpoly2_fast
70+
print("inpoly2_fast:", inpoly2_fast)
71+
PY
5072
- name: Test with tox
73+
env:
74+
OCEANMESH_INPOLY_ACCEL: "1"
75+
OCEANMESH_INPOLY_METHOD: ""
5176
run: |
52-
pip install tox
77+
python -m pip install tox
5378
tox
5479
- uses: codecov/codecov-action@v1

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
##############################################################################
2+
# LEGACY/UNSUPPORTED BUILD SCRIPT
3+
#
4+
# This CMake configuration is retained for historical reference only.
5+
# It is NOT used by the standard Python build, which uses setuptools with
6+
# pybind11 (see setup.py and pyproject.toml). Do not rely on this file for
7+
# normal development or installation. The supported build path is:
8+
# - pip/setuptools (Pybind11Extension) invoked via setup.py
9+
# On Windows, CMake may still be required by vcpkg solely to build CGAL
10+
# dependencies; it is not used to build oceanmesh itself.
11+
##############################################################################
12+
113
cmake_minimum_required(VERSION 2.8.12)
214

315
project(oceanmesh)

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ include README.md LICENSE.txt
55
global-include CMakeLists.txt
66
include versioneer.py
77
include oceanmesh/_version.py
8+
recursive-include oceanmesh/geometry *.py
9+
recursive-include oceanmesh/geometry *.pyx *.c

0 commit comments

Comments
 (0)