Skip to main content

License: GPL v3 pre-commit codecov

pyramids-mesh

pyramids-mesh reads and writes the file formats of hydrodynamic and hydraulic mesh models — 2DM, Selafin, DFSU, XMDF, PLY and more — as pyramids UGRID objects. pyramids-gis already ships the mesh data model and every operation that follows from a topology in hand; what it cannot do is open other people's mesh files. That is this package's job, and its only job.

What pyramids-gis owns today, and this package therefore does not reimplement:

  • The data model — Mesh2d, Network1d, UgridDataset, Connectivity, and UGRID-compliant NetCDF read/write.
  • Topology operations on a mesh already in hand — connectivity derivation, graph algorithms (components, RCM ordering, dilation/erosion, Voronoi, circumcenters, boundary extraction), facet remapping, spatial indexing.
  • Regridding and sampling — point sampling, rasterize_like, mesh-to-mesh conservative / barycentric / centroid regridding, temporal interpolation.
  • Conversion — mesh ↔ vector, construction from a raster grid or a polygon layer, xarray/zarr hand-off, gap filling.

What this package adds — file-format drivers, and nothing else:

  • Readers for the native formats of hydrodynamic and hydraulic solvers: 2DM (SMS / TUFLOW / BASEMENT), Selafin (TELEMAC), DFSU and DFS2 (DHI MIKE), XMDF and XDMF, DAT, FLO-2D, 3Di, H2i, Mike21, HEC-RAS 2D, plus the geometry interchange formats PLY and TIN.
  • Writers for the formats that support it — 2DM, Selafin, DAT, PLY, Mike21.
  • Discovery through the pyramids.mesh_drivers entry-point group, so UgridDataset.read_file("model.slf") just works once this package is installed.

Every mesh operation belongs upstream in pyramids-gis. A driver parses a file and builds pyramids.netcdf.ugrid objects; it implements no GIS, no interpolation and no analysis.

Status — 0.1.0 is the repository scaffold: packaging, CI, docs and the import contract. No mesh API is published yet. Follow the change log for what lands.

Naming note — the distribution name is pyramids-mesh (with hyphen), the Python import name is pyramids_mesh (with underscore).

Installation

The package is not published yet. Install it from source with Pixi:

git clone https://github.com/serapeum-org/pyramids-mesh.git
cd pyramids-mesh
pixi install -e dev      # creates the dev environment
pixi shell -e dev

One extra is declared: viz, which adds the plotting stack (pyramids-gis[viz] + cleopatra) that mesh rendering goes through. The dev environment installs it, so the tests run against the same set an installed user gets.

GDAL is not a dependency. The pyramids-gis wheel vendors its own osgeo bindings, and import pyramids is what puts them on sys.path — which is why import pyramids is the first import in every module here.

Supported Python: 3.11–3.14.

Project layout

src/pyramids_mesh/   — the package (import name: pyramids_mesh)
tests/               — pytest suite
docs/                — MkDocs sources (MkDocs Material + mkdocstrings)
docs/examples/       — example notebooks, validated by `pixi run notebooks`
examples/data/       — data the notebooks read, via notebook-relative paths

Documentation

Development

This repository uses Pixi for environment management.

pixi run main          # main test suite (excludes plot tests)
pixi run plot          # plot/visualization tests
pixi run test-all      # everything, with a terminal coverage report
pixi run notebooks     # validate example notebooks
pre-commit run --all-files

Branches and commits follow Conventional Commits: branch <type>/<short-description>, PR title <type>: <imperative summary>. Releases are driven by commitizen (pixi run cz-bump) and the shared serapeum-org/github-actions workflows.

License

GNU General Public License v3 — see LICENSE.

Metadata

Release files for pyramids-mesh 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyramids-mesh 0.2.0
File Size Uploaded Provenance Actions
pyramids_mesh-0.2.0.tar.gz 150.4 kB Without provenance Details for pyramids_mesh-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyramids-mesh 0.2.0
File Interpreter ABI Platform Actions
pyramids_mesh-0.2.0-py3-none-any.whl Python 3 none any Details for pyramids_mesh-0.2.0-py3-none-any.whl

Total release size: 294.1 kB

Release files / pyramids_mesh-0.2.0.tar.gz

Download URL pyramids_mesh-0.2.0.tar.gz
Size 150.4 kB
Tags Source
SHA-256 checksum
How to use checksums
910e8393edbc22fa78f2948694bd12f47062fea0bf734e5e0681b189b22ac925
BLAKE2b-256 checksum
How to use checksums
6050354d0d6e427f3239c934cd723c7e40c8fe65b099cf86c8791ff69ba0707f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / pyramids_mesh-0.2.0-py3-none-any.whl

Download URL pyramids_mesh-0.2.0-py3-none-any.whl
Size 143.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11a27a31bd7b4e0fd4c4d8124fdcef3a73b9a71d1630da85f8d70d1aa341c995
BLAKE2b-256 checksum
How to use checksums
88cb1bf16175750cdf3d731e309939ed21b3c50037a817874522b4235c890ac7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for pyramids-mesh 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page