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-core 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-core owns today, and this package therefore does not reimplement:

  • The data model — Mesh2d, Mesh1d, MeshDataset, 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 MeshDataset.read_file("model.slf") just works once this package is installed.

Every mesh operation belongs upstream in pyramids-core. 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-core[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-core 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.7.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.7.0
File Size Uploaded Provenance Actions
pyramids_mesh-0.7.0.tar.gz 307.9 kB Without provenance Details for pyramids_mesh-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 650.4 kB

Release files / pyramids_mesh-0.7.0.tar.gz

Download URL pyramids_mesh-0.7.0.tar.gz
Size 307.9 kB
Tags Source
SHA-256 checksum
How to use checksums
38abf03788df9a7aad58a17568325ae897da3f315d252e9c2098f5dae4a702d7
BLAKE2b-256 checksum
How to use checksums
bf2ebdce4f778bc66367b28b0a2ee5b49d9f81c411d55b40de02ad97c5e92ca1
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.7.0-py3-none-any.whl

Download URL pyramids_mesh-0.7.0-py3-none-any.whl
Size 342.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d3b8b8a8ac880f753e968ea52aa4aa0c85bd71effab0759ed4f977786007af8
BLAKE2b-256 checksum
How to use checksums
e58d981905219567a0e39067e6dd9961773aa21b68c23e62f8e915a0388f1dc9
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.7.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