hydromt.data_catalog.uri_resolvers.ConventionResolver#

pydantic model hydromt.data_catalog.uri_resolvers.ConventionResolver[source]#

URIDataResolver using HydroMT naming conventions.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

name: ClassVar[str] = 'convention'#
resolve(uri: str, *, time_range: TimeRange | None = None, mask: GeoDataFrame | GeoSeries | None = None, zoom: int | Tuple[float, str] | None = None, variables: list[str] | None = None, metadata: SourceMetadata | None = None, handle_nodata: NoDataStrategy = NoDataStrategy.RAISE) list[str][source]#

Resolve the placeholders in the URI using naming conventions.

Parameters:
  • uri (str) – Unique Resource Identifier

  • time_range (Optional[TimeRange], optional) – left-inclusive start end time of the data, by default None

  • mask (Optional[Geom], optional) – A geometry defining the area of interest, by default None

  • zoom (Optional[Zoom], optional) – zoom of the dataset, by default None

  • variables (Optional[list[str]], optional) – Names of variables to return, or all if None, by default None

  • metadata (Optional[SourceMetadata], optional) – DataSource metadata.

  • handle_nodata (NoDataStrategy, optional) – how to react when no data is found, by default NoDataStrategy.RAISE

Returns:

a list of expanded uris

Return type:

list[str]

Raises:

NoDataException – when no data is found and handle_nodata is NoDataStrategy.RAISE

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.