riverarchitect.config
Project-wide configuration: paths, units and the canonical NoData value.
Paths are resolved with os.path so that the same constants work on Windows and
POSIX. The original River Architect hard-coded "\\" separators throughout, which is
one of the reasons it could only run on Windows.
Data directories are resolved relative to a project root, which is by default the current
working directory. Point RIVERARCHITECT_HOME at a directory to override it, or
call set_project_home() at runtime.
- riverarchitect.config.NODATA = -999.0
Canonical NoData value for every raster River Architect writes.
Never test cell values against this constant directly. Go through the declared NoData mask instead (
rasterio.open(...).read(masked=True)), because third-party inputs carry-3.4e38,3.4e38,0or-9999interchangeably. Useriverarchitect.tools.reconcile_nodatato normalise an input condition.
- riverarchitect.config.FT2AC = 2.295684113865932e-05
Square feet to acres.
- riverarchitect.config.FT2M = 0.3048
Feet to metres.
- riverarchitect.config.CFS2CMS = 0.0283168466
Cubic feet per second to cubic metres per second.
- riverarchitect.config.UNITS = ('us', 'si')
Supported unit systems.
- riverarchitect.config.templates_dir()[source]
Directory holding packaged templates (layer styles, workbooks).
- riverarchitect.config.project_home()[source]
Root directory of the user’s project data.
Resolution order: an explicit
set_project_home(), then theRIVERARCHITECT_HOMEenvironment variable, then the current working directory.
- riverarchitect.config.set_project_home(path)[source]
Set the project root that the
dir_*helpers resolve against.
- riverarchitect.config.dir_conditions()[source]
Directory holding input conditions (one sub-folder per condition).
- riverarchitect.config.dir_output(module='')[source]
Output directory, optionally for a named module.