Skip to main content

python package to read/write/manage Marthe Grids

Project description

PyPI - Version Conda Version GitLab License

Gridmarthe

gridmarthe is a Python project for (fast) Marthe grid operations.

MARTHE is a hydrogeological modelling code developped at BRGM, French Geological Survey (Thiery, 2020), and is available at https://www.brgm.fr/en/software/marthe-modelling-software-groundwater-flows

gridmarthe in a nutshell

gridmarthe allow users to read/write efficiently Marthe Grids (v9, v8, constant_data, etc.) with python, for any MARTHE variable.

With the gridmarthe API, data are stored in a xarray dataset, and can be manage with xarray functions (or numpy). Specific treatments/functions are also provided by gridmarthe.

The package also install different command line tools: ncmart to convert Marthe Grid to netCDF format, martshp to convert in shapefile/geopackage, cleanmgrid to fix marthe grid format.

Full documentation and tutorials can be founded at https://gridmarthe.readthedocs.io

Grids are stored as a 2 dimensions matrix composed of a 1D spatial vector and a time dimension (Reduced Horizontal Grid, as recommended for lossless compression by gathering in cf-conventions: see cf-compression-gathering and cf-reduced-horizontal-grid). This means that the spatial domain is flatten in grid, and each point is associated with a index, a x coordinate, a y coordinate, eventually a z coordinate (number of layer in most cases), and dx, dy values.

Still, as Marthe meshes are always parallelepiped, the array does not necessarily follow the ugrid convention. This may be an evolution for future version if required.

The x, and y coordinates are the center of cell. dx, dy are the dimensions of the cell.

Installation

From pip

On pip, gridmarthe is available for GNU/Linux, and Windows for python >=3.10. Users can install it with:

pip install gridmarthe
# or with all optional dependencies
pip install gridmarthe[opt]

For UNIX systems, the package needs gfortran/gcc shared libraries to run. For example, using a Debian-based GNU/Linux distribution, one can install gcc with:

sudo apt install gcc gfortran

From conda-forge

gridmarthe is also available in the conda-forge channel (Linux, Windows). Conda users can install it with:

conda install gridmarthe
# or, with mamba
mamba install gridmarthe

From sources

gridmarthe use some Fortran modules which need to be compiled before local installation, hence user/developer who want to install from sources will need a Fortran and a C compiler.

Compilation and installation

Get the sources :

git clone https://gitlab.com/brgm/hydrogeological-modelling/marthe-tools/gridmarthe
cd gridmarthe
With pip (Unix-like OS)

On a Unix-like machine, with gfortran, ninja-build, python3, the project Makefile will compile Fortran sources and install in development mode (i.e. with editable flag) the package.

make requirements
make

or, without the development/editable mode :

pip install .

On a Windows machine, it is possible to compile with gfortran/gcc (mingw project https://mingw-w64.org/ or https://winlibs.com/#download-release ; it can also be installed with chocolatey choco install mingw, or with conda with conda-forge packages mingw-w64, gcc and gfortran).

With conda (recommended on Windows)

It is also possible to install gridmarthe in a conda environment. An environment file is provided (example with mamba):

mamba env create -n gm -f environment.yml
mamba activate gm
make

This will install the library using pip editable mode, but with dependencies installed from conda-forge.

Alternatively, you can use conda-build:

mamba env create -n gm -f environment.yml
mamba activate gm
mamba install conda-build
make lib  # only compile shared library for python bindings
conda develop src/

Usage

Simple examples can be found in the documentation.

License

This program is free software and released under the terms of the GNU General Public License (version 3 or later).

Authors and acknowledgment

gridmarthe is released by (C) BRGM, French Geological Survey

Authors and contributors:

  • A. Manlay,
  • J.P. Vergnes,
  • S. Wang,
  • S. Lopez,
  • S. Magne

References

Thiery, D. (2020). Guidelines for MARTHE v7.8 computer code for hydro-systems modelling (English version) (Report BRGM/RP-69660-FR; p. 246 p.) http://ficheinfoterre.brgm.fr/document/RP-69660-FR

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gridmarthe-0.4.0.tar.gz (162.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gridmarthe-0.4.0-cp314-cp314t-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.14tWindows x86-64

gridmarthe-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

gridmarthe-0.4.0-cp314-cp314-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.14Windows x86-64

gridmarthe-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

gridmarthe-0.4.0-cp313-cp313-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.13Windows x86-64

gridmarthe-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

gridmarthe-0.4.0-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

gridmarthe-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

gridmarthe-0.4.0-cp311-cp311-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86-64

gridmarthe-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file gridmarthe-0.4.0.tar.gz.

File metadata

  • Download URL: gridmarthe-0.4.0.tar.gz
  • Upload date:
  • Size: 162.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gridmarthe-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5f0955fd7222e462c95b4e0a4ee7ba0dd88d7382686e7ed9aa18f25514c1c0a6
MD5 bade9855455487992b06b20acc8834fc
BLAKE2b-256 0a6ba3e510bd17941b5c8fabcad55efa905b5b650931f6417b55233d5336044f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0.tar.gz:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: gridmarthe-0.4.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gridmarthe-0.4.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 43c07ceaf888aa091e9e0f146d94db86f6813b88be18d435a12744e13ddb4b6d
MD5 f1c1324ace51e433c57a548481c8673d
BLAKE2b-256 6d08214f70b7874c1771c90fe3929d02b9f4756840b176d9a8c9110e644e860c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp314-cp314t-win_amd64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gridmarthe-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 224f1853e3c4ce9ddce85314240d05eb80d8c58a208829f7cd56b153cd7a24b8
MD5 600110ff5098be0e449e32cf2e098ddb
BLAKE2b-256 2185c3482f9a6642e2fe43aeed25a983836b605917a48ded2140d79bcd4bd398

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: gridmarthe-0.4.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gridmarthe-0.4.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 5fa7a1767866694edfeee475c166ef5610a464cbafbb3c08c15f71260fa4a4b3
MD5 53992ccd1b2a03898f3a5e8a9310411c
BLAKE2b-256 f9a434ccae9b364a8ece2cdcd49214b50bdd08b36d58ffb149c7c693aeb1029a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp314-cp314-win_amd64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gridmarthe-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1ddb7bd733a7c89ab2cc87ab820a8a26d1a0129ea0f5c77793ddadf12e29fc73
MD5 b9df303d345aeecc0807a71406033bbd
BLAKE2b-256 7f3ff6a41ef147e255f0281684725a697749e440726cf44e118416980cd4649e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: gridmarthe-0.4.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gridmarthe-0.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7520097f9d6ad50077e7cb2b23878465a0b5b0d7024f3c7a432b5b9495bf4945
MD5 f8133e0b46e0f3cac78d70818e9cf93e
BLAKE2b-256 a958c216ed4a09dfc317c02a2fc1e2c87639fc621aba7b83c6f6c0b6abb191d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp313-cp313-win_amd64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gridmarthe-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 50ac89c120fb149a180f60ef24dc79ab6701780dbe3e8243b9ad5629c8b38398
MD5 c50384da4d19f4a30e26bd3b95451fe6
BLAKE2b-256 973f54203df3b89989ab76407fd255292ce2f433cc00c7ce9281148dcea87e0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gridmarthe-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gridmarthe-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3125b46f6ce9d8eff71db3bec834239bed2c24878ebf7908b003c0ef6b892239
MD5 48609ffdca71a8157dd1376afd607a34
BLAKE2b-256 1a31aac22ea7cc8b3de1bc513961afe2e6ee05df092cae239936493ed71a00f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp312-cp312-win_amd64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gridmarthe-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a0e1e69726408442e58831112073bf19920b7f61d8d28f97a04bdfcae48d26d5
MD5 224648bb014edccbaf1ad9f717449fc3
BLAKE2b-256 ba2734f14fcc21541f635ee53512af752bd34693c82db94cee823c1ea7e5767e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: gridmarthe-0.4.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gridmarthe-0.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 555f4ba4dc359ce27bc4386313931ab672a9bc676a41fdffa9a7961aba25e662
MD5 a12c06561f68e167434d95e0fee20f22
BLAKE2b-256 7feb70a00714377e14dc1c125f2324992241d50861cd06383234b8d9e79bbfc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp311-cp311-win_amd64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gridmarthe-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gridmarthe-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c88399eedbfe060d9ff53ceb213e883e865b865f0007a3b016a3ff34431b6582
MD5 c42f4c8318616b0cc1963d41e47324d6
BLAKE2b-256 9b3fcb8884e298185eea652b91d07720cafd6210333beb2342849ae06d177658

See more details on using hashes here.

Provenance

The following attestation bundles were made for gridmarthe-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on manlaya/gridmarthe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page