Skip to content

misc updates in prep for 2.0

King, Jonathan M requested to merge ghsc/users/jking/pfdf:misc2.0 into main

Summary

This MR provides various small additions in preparation for wildcat and pfdf 2.0.

Wildcat

  • New method: Raster.ensure_nodata -- provides a default NoData value if NoData is missing
  • Rasters factories now call "ensure_nodata" by default. This can be disabled with the "ensure_nodata" option
  • Added informative errors when a polygon dataset does not overlap indicated bounds (_utils.features.process)
    • Added the new errors.NoFeaturesError for this

Models

These are the backwards-compatibility changes most likely to affect users

  • Renamed s17.probability to s17.likelihood
  • g14 now returns Vmin and Vmax (in addition to volume)
    • Users can optionally specify the RSE for the 95% CI calculation

CRS Units / projection

Added various properties with info on CRS units. All properties are sourced from the _crs.units and _crs.units_per_m functions

  • BoundingBox/Transform: units, xunit, yunit, units_per_m, x_units_per_m, y_units_per_m
  • Raster: crs_units, crs_units_per_m
  • Segments: crs_units
  • BoundingBox/Transform.isclose: True if approximately equal to a second projection object. Mostly for accounting for machine error when testing

Utility Modules

  • utils.intensity: Convert between rainfall accumulations and intensities
  • utils.nodata: Info on default nodata values

Segments

  • segments.prune: Removes nested drainages (facilitates cleaner export of outlet points)
  • geojson/save: Users can now export string properties (formerly just numeric)
  • geojson/save: Properties can now have nSegments elements when exporting basins, and the elements corresponding to the basins will be extracted

Closes #132 (closed), #131 (closed), #129 (closed), #125 (closed), #123 (closed), #120 (closed), #119 (closed), #117 (closed), #116 (closed), #115 (closed), #114 (closed), #109 (closed), #95 (closed),

Edited by King, Jonathan M

Merge request reports

Loading