gridmarthe changelog

[0.5.3] - 2026-10-03

Fixed

  • hotfix: reading grid with timestep -9999. and a pastp file

[0.5.0] - 2026-10-02

Added

  • grid creation (from xy bounds or shape) / beta for nested grid

    • functions create_grid_domain for regular grids from array dimensions,

    • create_grid_from_shape for regular grids from shapefile,

    • add_zoom to add nested grids with array dimensions,

    • add_zoom_from_shape to add nested grids from shapefile (still beta)

  • function create_ugrid to define arrays and attributes following ugrid netCDF convention, from a gridmarthe dataset. This allow better interactions with GIS software QGIS for vizualization and manipulation (see MeshLayer).

  • sel_by_coords function to allow selection of a subset of the grid with x, y [z] coordinates, on a 1D-spatial dataset, without requiring assign_coords (see #25)

  • get_dims_from_ds to recreate dims array from dataset dimensions

  • mask_nest_bound to retrieve nested grid bounds (halo) indices in grid

  • more options from load_marthe_grid for ncmart scripts, see #23

Changed

  • dates argument in gridmarthe.load_marthe_grid is renamed times to be consistent with time dimension

  • gm.plot_nested_grid calling without assign_coords is now allowed

  • layer and time dimensions can be query in gm.plot_nested_grid

  • dropna() now detect varname and nan_value.

  • revert change from v0.4.0 in assign_coords: sorting y in descending order cause error when slicing the xarray.Dataset, this is removed. See #24

  • improvement of matplotlib args/kwargs in cross section plot, see !14

Deprecated

  • subset_by_coords is deprecated in favor of sel_by_coords

Fixed

  • read int/float times in timestep file (pastp)

  • compute geometry with other variable names (names are now arguments with defaults)

  • time dimension in vtk writer

  • search_zone now returns a list of indices if query with xy on multilayer grids

  • gridmarthe.compute_geometry on single layer models (no z coordinate), see 0c3986e

  • reading file with path length > 132 characters now allow (see #21)

  • Fortran IO error is now returned to python caller for better exception management (see !13)

  • reading grid with shallow_only is now allowed for nested grids (see #22)

  • fixes for raster export without time dimensions (see !12)

  • drop_time in load_marthe_grid now use ‘squeeze’ instead of ‘drop’ to avoid dropping variable using this dimension, see #26

Tests

  • refactor tests, improved coverage

  • add development CI

[0.4.0] - 2026-05-27

Added

  • add: drainage direction computation from legacy fortran sources

  • add: river network computation from legacy fortran sources #7

  • add: drop_time argument to gridmarthe.load_marthe_grid to drop dummy time dimension when reading parameter grids.

Changed

  • change: default to varname=None when writing a marthe grid file (and guess first non dim variable)

  • change: use integer as default dummy time dimension for parameters grid, instead of ‘1850-01-01’ fake date.

  • refact: code refactoring/reorganization with new fortran subroutines

Fixed

  • add/fix: reading grid with bad metadata (variable name, number of grids/layers) is now possible with fortran core module (fix_metada subroutine)

  • fix: reading single grid output, even without metada (read_shallow parameter) 1st non dimension/coord variable will be selected. add .lower() security for user’s variable

  • fix: using load_marthe_grid with a Path object #14

  • fix: bad return array with get_active_mask #13

  • fix: order of y coordinates in stack coords #11

  • fix: cleanmgrid script #10 #15 #17

  • fix: ncmart script #9

  • fix: netcdf attrs conflict with missing value #16

Removed

  • drop support for python 3.10. Minimal requirement is now python 3.11

[0.3.0] - 2025-12-09

Added

  • add: beta support for vtk export, based on vtkwriters from ComPass code python ecosystem

  • add: support for reading/plotting velocity field : gm.read_velocity, gm.plot_veloc_quiver

  • add: beta support for cross section

  • add: options to ncmart script:

    • --dump (-H) to mimic ncdump -H command (netcdf CLI tools).

    • --attrs (-a) to add global attributes

    • treat input if already in netcdf fmt (modify it, with scale factor or attrs, to 2D, etc)

Changed

  • change: attributes in netcdf to be more CF-Conventions compliant:

    • add crs attributes using pyrpoj.CRS().to_cf() for QGIS view compatibilty –> add argument epsg in gm.load_grid_marthe

    • add compress attribute for zone https://cfconventions.org,

    • fix attributes for coordinates x,y,z / add argument full_3d to set z attributes

    • force attributes for x,y,z to be kept when gm.assign_coords

Fixed

  • fix: cleanmgrid with conda #8

[0.2.0] - Unreleased

Changed

  • nanval argument in load_marthe_grid is rename to nan_value as in write_marthe_grid

  • keepligcol argument in load_marthe_grid is rename to add_col_row to be more coherent with add_id_grid

Fixed

  • error when writing grid with time slice (cf. issue #3)

  • fix: REVERT change from 0.1.3 : zone index is NOT reset (as in 0.1.2 and previous versions). when the drop_nan option is used in load_grid_marthe(). A new variable ‘izone’ store the reset form. See issue #4

Removed

  • xr.Dataset.mart class accessor is removed. It will be included as wrapper in future marthe python library.

[0.1.3] - 2025-09-02

Added

  • add geometry functions (get_mask_array, compute_geometry)

  • add reprojection functions (still experimental)

  • add martshp script to easily convert a marthe grid file into a shp/gpkg file in command line

  • add automatic tests

Changed

  • change: rename function to write raster: to_raster() instead of write_raster_from_da()

  • change: zone index is reset when the drop_nan option is used in load_grid_marthe(). A new variable ‘zone_all’ store the old index for the reset_geometry() method

  • code refactoring (lecsem module and global organization)

Fixed

  • minor fixes in plot method

[0.1.2] - 2025-01-09

  • Change build to meson

  • fix scripts ‘ncmart’ and ‘cleanmgrid’ paths

  • update write method

[0.1.1] - 2024-11-03.

  • first release as a stand alone package

[0.0.1] - Unreleased

Unreleased, internal dev at BRGM - 2021-2024

  • Use fortran sources from Marthe with f2py to read grids, single layer, homogeneous grids (1st version from JP Vergnes)

  • Extend to multilayer, nested grid (A Manlay)

  • Python wrappers for easy read operations (AM)

  • Add write method in Fortran sources, scan var and wrappers (AM)

  • Add command line scripts, and some derived treatments (surface layer, rescale, etc.)