SviModel

database_builder.SviModel()

Model for Social Vulnerability Index (SVI) configuration.

Attributes

classes : list[str], default=["Low", "High"]

List of vulnerability class names.

colors : list[str], default=["#D5DEE1", "#88A2AA"]

List of colors corresponding to each vulnerability class.

thresholds : list[float], default=[0.7]

List of threshold values for vulnerability classification.

Methods

Name Description
validate_colors_length Validate that colors list length matches classes list length.
validate_thresholds_length Validate that thresholds list length is one less than classes list length.

validate_colors_length

database_builder.SviModel.validate_colors_length(colors, info)

Validate that colors list length matches classes list length.

Parameters

colors : list[str]

List of color values.

info : Any

Field validation info containing all field values.

Returns

: list[str]

The validated colors list.

Raises

: ValueError

If colors length doesn’t match classes length.

validate_thresholds_length

database_builder.SviModel.validate_thresholds_length(thresholds, info)

Validate that thresholds list length is one less than classes list length.

Parameters

thresholds : list[float]

List of threshold values.

info : Any

Field validation info containing all field values.

Returns

: list[float]

The validated thresholds list.

Raises

: ValueError

If thresholds length is not one less than classes length.

Back to top