v1.3.0
v1.3.0 (2025-11-11)
ModelComponent API now contains functions for ModelComponent.cleanup and ModelComponent.finish_write that are called by the build and update functions. This stabilizes the write functionality and makes sure that netCDF files can be overwritten when the source and destination are the same. (#778)
New
- Added
ExampleModelclass andexample_modelentrypoint for demonstration purposes. - Added option for delayed compute in writing netcdf files
- Added option to specify a 'fill_value' in
gis.raster_utils.full,full_from_transformandfull_like. (#1321) - Set compression in
write_nc - Allow masking in
GridComponent.set. (#1229) - Default driver is now inferred from file extension for RasterDataset, GeoDataFrame, and GeoDataset sources. (#1267)
_io.readers.open_ncand_io.readers.open_ncsalways return anxr.Dataset. This Dataset is the one that needs to be closed before overwriting on disk.- All
ModelComponent.writecalls return an optionalDeferredFileClosethat can be called after the openxr.Datasetobjects are closed. _io.writers.write_ncwrites to a temporary file inside of the working folder of the caller, not to a temporary directory. Changed, because hydromt cannot know how much space is required. The caller should handle their workspaces well.hydromt checkaccepts a--formatflag to check either v1 or v0 data catalogs (#1265)hydromt checkaccepts a--upgradeflag to upgrade v0 datacatalogs to the new v1 format (#1265)Modelcan now be used as a context manager. This ensures that all open files are closed when exiting the context. (#1272)RasterioDrivernow supports writing tif files. (#1332)
Changed
hydromt.ioand its functions are now public (underscore removed). (#1271)- Reading the hydromt workflow yaml is now done with
hydromt.io.read_workflow_yaml. (#1271) - Important GIS methods are now public in
hydromt.gis.gis_utils,hydromt.gis.raster_utilsandhydromt.gis.vector_utils. (#1271) - HydroMT raster utilities such as
full,full_from_transform,full_likeandmergehave been moved tohydromt.gis.raster_utils. (#1271) DataCatalog.driver.preprocessingand its functions are now public (underscore removed). (#1271)NoDataStrategyis now part of ofhydromt.errorand thus public (#1277)hydromt.typingand its functions are now public (underscore removed). (#1286)- remove
iosubmodule and movereadersandwritersto the root module (#1308) write_ncfunction no longer accepts kwargs, instead a dictto_netcdf_kwargsis used to pass arguments toxarray.to_netcdf. The function raises an error when "compute" is one of the arguments.- Function signatures of
DataCatalogfunctionsget_rasterdataset,get_geodataframe,get_geodataset,get_datasetandget_dataframenow have:source_kwargs(passed toDataSource.__init__) instead of justkwargs, andtime_tuplewas renamed totime_range. (#1291) DataCatalogargument fallback_lib has been removed. Users now have to specify the name of the data catalog they want to use, even if it is artifact_data (#1069).GeomsComponent.regionnow returns the geometric union of all polygonal features in the component instead of a bounding box. Only geometries with area (Polygons and MultiPolygons) contribute to the union; Points, LineStrings, and MultiLineStrings are excluded and assumed to lie within the polygon-defined area. (#1334)- When writing zarr files, by default write with
zarr_format=2. Can be overwritten with thewrite_kwargsargument.
Fixed
- Actually having 'nan' values in a lazy DataArray from
gis.raster_utils.full. (#1321) - CLI update command was not working. (#1244)
- Allow models to not have a spatial component (allows updating if region is None). (#1244)
- CF compliant dimensions in netcdf files
bufferargument inDataCatalog.get_rasterdatasetnow is an integer expressed in resolution multiplicity instead of in meters. (#1245)- Improved logging information for build and update functions. (#1237)
- Better documentation of drivers and their options. (#1271)
- Passing options to
geodataframe_tabledriver now works. (#1271) - Relative path in the workflow yaml were not correctly resolved. (#1304)
- Fix pydantic for V1 catalog for nodata and fix the catalog upgrade to convert nodata and extra metadata arguments. (#1304)
- Fix pydantic for V1 catalog for attrs and fix the catalog upgrade to convert attrs arguments.
- Do not pass metadata "extent" from catalog in xarray objects to avoid issues when writting to netcdf. (#1304)
- Build and update functions call
ModelComponent.cleanupandModelComponent.finish_write. Stabilizing the write functionality and making sure that netCDF files can be overwritten when the source and destination are the same. (#778) hydromt checkhas been updated to validate v1 data catalogs (#1265)- All handling of log files is now done with the context manager
hydromt._utils.log.to_file. This means that they are always closed by the the function that opened them. (#1272) DataCatalog.export_datanow correctly handles rasterdata that have been written with paths containing wildcards. (#1323)- Standardized the behaviour of DataSources and subcomponents when it comes to handling the case where there is no data.
- Logging of warnings when unused kwargs are passed.
Deprecated
Removed
- opt and components CLI options for build and update. A configuration workflow file is now mandatory. (#1244)
- From the
GridComponent, the functionscreate_from_region,add_data_from_constant,add_data_from_rasterdataset,add_data_from_raster_reclass,add_data_from_geodataframe. (#1229) Equivalent workflows are still available. - From the
MeshComponent, the functionscreate_2d_from_region,add_2d_data_from_rasterdataset,add_2d_data_from_raster_reclass. (#1229) Equivalent workflows are still available. GridComponent,MeshComponent,GeomsComponent, andVectorComponentno longer write the region onwrite. The functionSpatialModelComponent.write_regionis still available for plugin implementors.stats.eva_block_maximaandstats.eva_peaks_over_threshold. Usestats.evainstead.