gedih3.exceptions#

gedih3 Exception Hierarchy

Custom exceptions for structured error handling throughout the package. All exceptions inherit from GediError for easy catching of package-specific errors.

Usage:

from gedih3.exceptions import GediDownloadError, GediValidationError

try:

download_granule(granule, odir)

except GediDownloadError as e:

logger.error(f”Download failed: {e}”)

Attributes#

Exceptions#

GediError

Base exception for all gedih3 errors.

GediNetworkError

Base exception for network-related errors.

GediDownloadError

Error during file download from NASA DAAC.

GediAuthenticationError

Error during NASA Earthdata authentication.

GediS3AccessError

Error accessing GEDI data via S3.

GediIncompleteListingError

CMR returned fewer granules than its own CMR-Hits count (silent truncation).

GediValidationError

Base exception for validation errors.

H3ValidationError

Error in H3 parameter validation.

EGIValidationError

Error in EGI parameter validation.

GediProductError

Error with GEDI product specification.

GediVariableError

Error with GEDI variable specification.

GediFileError

Base exception for file-related errors.

GediHDF5Error

Error reading/processing HDF5 file.

GediParquetError

Error reading/writing Parquet file.

GediCorruptedFileError

File is corrupted or unreadable.

GediTransactionError

Error during atomic file operation.

GediDatabaseError

Base exception for H3 database errors.

GediDatabaseNotFoundError

H3 database directory not found.

GediDatabaseCorruptedError

H3 database is corrupted or inconsistent.

GediMergeError

Error merging H3 partitions or databases.

GediSpatialError

Error with spatial operations or filters.

GediTemporalError

Error with temporal operations or filters.

GediProcessingError

Base exception for data processing errors.

GediAggregationError

Error during data aggregation.

GediRasterizationError

Error during rasterization.

GediImageSamplingError

Error during raster image sampling at GEDI shot locations.

GediSpatialJoinError

Error during spatial join of vector data to GEDI shot locations.

Functions#

is_retryable_error(→ bool)

Determine if an exception is retryable.

Module Contents#

exception gedih3.exceptions.GediError[source]#

Bases: Exception

Base exception for all gedih3 errors.

exception gedih3.exceptions.GediNetworkError[source]#

Bases: GediError

Base exception for network-related errors.

exception gedih3.exceptions.GediDownloadError(message: str, granule_id: str = None, attempts: int = None)[source]#

Bases: GediNetworkError

Error during file download from NASA DAAC.

granule_id = None#
attempts = None#
exception gedih3.exceptions.GediAuthenticationError[source]#

Bases: GediNetworkError

Error during NASA Earthdata authentication.

exception gedih3.exceptions.GediS3AccessError[source]#

Bases: GediNetworkError

Error accessing GEDI data via S3.

exception gedih3.exceptions.GediIncompleteListingError(message: str, expected: int = None, received: int = None)[source]#

Bases: GediNetworkError

CMR returned fewer granules than its own CMR-Hits count (silent truncation).

expected = None#
received = None#
exception gedih3.exceptions.GediValidationError[source]#

Bases: GediError

Base exception for validation errors.

exception gedih3.exceptions.H3ValidationError(message: str, param_name: str = None, value=None)[source]#

Bases: GediValidationError

Error in H3 parameter validation.

param_name = None#
value = None#
exception gedih3.exceptions.EGIValidationError(message: str, param_name: str = None, value=None)[source]#

Bases: GediValidationError

Error in EGI parameter validation.

param_name = None#
value = None#
exception gedih3.exceptions.GediProductError[source]#

Bases: GediValidationError

Error with GEDI product specification.

exception gedih3.exceptions.GediVariableError[source]#

Bases: GediValidationError

Error with GEDI variable specification.

exception gedih3.exceptions.GediFileError[source]#

Bases: GediError

Base exception for file-related errors.

exception gedih3.exceptions.GediHDF5Error(message: str, file_path: str = None)[source]#

Bases: GediFileError

Error reading/processing HDF5 file.

file_path = None#
exception gedih3.exceptions.GediParquetError(message: str, file_path: str = None)[source]#

Bases: GediFileError

Error reading/writing Parquet file.

file_path = None#
exception gedih3.exceptions.GediCorruptedFileError(message: str, file_path: str = None)[source]#

Bases: GediFileError

File is corrupted or unreadable.

file_path = None#
exception gedih3.exceptions.GediTransactionError(message: str, source_path: str = None, dest_path: str = None)[source]#

Bases: GediFileError

Error during atomic file operation.

source_path = None#
dest_path = None#
exception gedih3.exceptions.GediDatabaseError[source]#

Bases: GediError

Base exception for H3 database errors.

exception gedih3.exceptions.GediDatabaseNotFoundError[source]#

Bases: GediDatabaseError

H3 database directory not found.

exception gedih3.exceptions.GediDatabaseCorruptedError[source]#

Bases: GediDatabaseError

H3 database is corrupted or inconsistent.

exception gedih3.exceptions.GediMergeError[source]#

Bases: GediDatabaseError

Error merging H3 partitions or databases.

exception gedih3.exceptions.GediSpatialError[source]#

Bases: GediError

Error with spatial operations or filters.

exception gedih3.exceptions.GediTemporalError[source]#

Bases: GediError

Error with temporal operations or filters.

exception gedih3.exceptions.GediProcessingError[source]#

Bases: GediError

Base exception for data processing errors.

exception gedih3.exceptions.GediAggregationError[source]#

Bases: GediProcessingError

Error during data aggregation.

exception gedih3.exceptions.GediRasterizationError[source]#

Bases: GediProcessingError

Error during rasterization.

exception gedih3.exceptions.GediImageSamplingError[source]#

Bases: GediProcessingError

Error during raster image sampling at GEDI shot locations.

exception gedih3.exceptions.GediSpatialJoinError[source]#

Bases: GediProcessingError

Error during spatial join of vector data to GEDI shot locations.

gedih3.exceptions.RETRY_DEFAULTS#
gedih3.exceptions.is_retryable_error(exception: Exception) bool[source]#

Determine if an exception is retryable.

Returns True for transient network errors that may succeed on retry.