Skip to content

Backend - validate user inputs, NoData values, etc

King, Jonathan M requested to merge ghsc/users/jking/pfdf:20-nodata-backend into main

Overview

This merge request introduces a number of modules that define and consolidate a backend for the package. Specifically, these are:

  • errors - A module to hold custom Exceptions
  • typing - Common type hints used throughout the package
  • utils - Various low-level utilites. Mostly argument parsing, raster I/O, and NoData values
  • validate - Functions that validate user-inputs and return them in standard formats for internal processing.

Also, the "dem" module has been updated to conform to the new backend, and there are also tests for the new/updated modules in the "tests" folder. The majority of "dem" updates involve adding options to support NoData values.

Notes

I've removed the large "operational user" script from the "dem" module for the time being. I also plan to refrain from writing these for a while. Ultimately, the large single-command scripts are complex to test/review/maintain, so I think it would be best to wait until the main code has stabilized.

The "stream" module and low-level "dem" functions have not changed since the last merge request, so these do not need review. (Note that the low-level dem functions are distinct from the private functions - the private functions do need review).

I'd recommend doing the review in the following order: typing, errors, utils, validate, dem. Or perhaps the "typing" and "errors" modules might make more sense with the context of the "validate" module...

Edited by King, Jonathan M

Merge request reports