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, 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-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.5.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.5.0
File Size Uploaded Provenance Actions
pyramids_mesh-0.5.0.tar.gz 278.1 kB Without provenance Details for pyramids_mesh-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 588.5 kB

Release files / pyramids_mesh-0.5.0.tar.gz

Download URL pyramids_mesh-0.5.0.tar.gz
Size 278.1 kB
Tags Source
SHA-256 checksum
How to use checksums
94d1b8d8203c555717007f3bfcf518a7dd5581587a2a394dc9a04da5e080051e
BLAKE2b-256 checksum
How to use checksums
cfda507f8db2225516945c826cf0e55fe9917c5716264a29b45123c6341664bf
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.5.0-py3-none-any.whl

Download URL pyramids_mesh-0.5.0-py3-none-any.whl
Size 310.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3ecc076e697194ed09c23427acbd7040db5e75ff1278234a32beafbe6fb2190
BLAKE2b-256 checksum
How to use checksums
03f5b1d171304e45a709e5027951bc34b852da5ca2dd619628162080c9fcc50e
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.5.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