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.5.2

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.2
File Size Uploaded Provenance Actions
pyramids_mesh-0.5.2.tar.gz 280.1 kB Without provenance Details for pyramids_mesh-0.5.2.tar.gz

Built distribution (wheel)

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

Total release size: 590.6 kB

Release files / pyramids_mesh-0.5.2.tar.gz

Download URL pyramids_mesh-0.5.2.tar.gz
Size 280.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8b97e9588903373920a91eed106e40f9a35b31858c0d7ea70acc0f7e2d0e4b4a
BLAKE2b-256 checksum
How to use checksums
1e41b5878e9809a9064104db1cda3fa950c00213fc97688f047f44588b4a305c
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.2-py3-none-any.whl

Download URL pyramids_mesh-0.5.2-py3-none-any.whl
Size 310.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e76e21c72ea62fc9958fdbf73e2af1a73208574fb4d8d8b0ed449f75dadc2005
BLAKE2b-256 checksum
How to use checksums
6ab8265349eb7a8d26734ce76ad3a53c043962f11aebfcf92e0e47242ec6c208
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.2

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