revrt.models.cost_layers.LayerBuildConfig#

class LayerBuildConfig(*, extent: Literal['all', 'wet', 'wet+', 'landfall', 'dry+', 'dry'] = 'all', global_value: float | None = None, map: dict[float, float] | None = None, bins: list[RangeConfig] | None = None, pass_through: bool | None = False, rasterize: Rasterize | None = None, forced_inclusion: bool = False)[source]#

Bases: BaseModel

Friction and barrier layers config model

The inputs global_value, map, bins, rasterize, and forced_inclusion are exclusive, but exactly one must be specified.

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.

Methods

Attributes

model_computed_fields

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_extra

Get extra fields set during validation.

model_fields

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

extent

Extent to apply map or range to

global_value

Global value to use for entire layer extent

map

Values in raster (keys) and values to use layer

bins

Ranges of raster values

pass_through

Pass cost data through without extra processing

rasterize

Rasterize a vector and save as layer

forced_inclusion

Force inclusion

extent: Literal['all', 'wet', 'wet+', 'landfall', 'dry+', 'dry']#

Extent to apply map or range to

Must be one of the following:

  • ‘all’: Full extent, including offshore, onshore, and landfall

  • ‘wet’: offshore extent only

  • ‘wet+’: offshore extent + landfall extent

  • ‘landfall’: landfall extent (area between wet and dry extents)

  • ‘dry+’: onshore extent + landfall extent

  • ‘dry’: onshore extent only

By default, ‘all’.

global_value: float | None#

Global value to use for entire layer extent

map: dict[float, float] | None#

Values in raster (keys) and values to use layer

bins: list[RangeConfig] | None#

Ranges of raster values

This input can be one or more ranges of raster values to apply to barrier/friction. The value of overlapping ranges are added together.

pass_through: bool | None#

Pass cost data through without extra processing

rasterize: Rasterize | None#

Rasterize a vector and save as layer

forced_inclusion: bool#

Force inclusion

If forced_inclusion is True, any cells with a value > 0 will force the final value of corresponding cells to 0. Multiple forced inclusions are allowed.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property model_extra: dict[str, Any] | None#

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to “allow”.

property model_fields_set: set[str]#

Returns the set of fields that have been explicitly set on this model instance.

Returns:
A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.