ras

Cached lookup of installed HEC-RAS versions and their COM ProgIDs.

rivia.controller.ras.installed_ras_directory(version)[source]

Return the installation directory for the given HEC-RAS version.

Parameters:

version (str or int) – HEC-RAS version string (e.g. "6.3") or integer code (e.g. 6030).

Returns:

Absolute path to the HEC-RAS installation folder, or None when the registry entry has no location recorded.

Return type:

str or None

Raises:

RuntimeError – If the requested HEC-RAS version is not found in the registry.

rivia.controller.ras.installed_ras_display_name(version)[source]

Return the Windows display name for the given HEC-RAS version.

Parameters:

version (str or int) – HEC-RAS version string (e.g. "6.3") or integer code (e.g. 6030).

Returns:

Display name as recorded in the Windows registry (e.g. "HEC-RAS 6.3"), or None when the registry entry has no name.

Return type:

str or None

Raises:

RuntimeError – If the requested HEC-RAS version is not found in the registry.

rivia.controller.ras.installed_ras_progid(version)[source]

Return (version_xxxx, progids) for the requested HEC-RAS version.

Parameters:

version (str | int) – Any format accepted by ras_registry_xxx (e.g. “6.4.1”, 641, “RAS63”).

Return type:

tuple[int, dict[str, str | None]]

Returns:

  • version_xxxx – Numeric version code (e.g. 6410).

  • progids – Dict with keys “controller”, “geometry”, “flow”. Each value is the COM ProgID string if registered, otherwise None.

Raises:

RuntimeError – If the requested version is not found in the installed HEC-RAS entries.

rivia.controller.ras.installed_ras_versions(descriptive=False)[source]

Return a list of installed HEC-RAS versions.

Parameters:

descriptive (bool) – If True, return human-readable display names (e.g. “HEC-RAS 6.4.1”). If False (default), return numeric version codes (e.g. 6410).

Return type:

list[str]