reVeal.config.characterize.Characterization#
- class Characterization(*, dset: str, data_dir: Annotated[Path, PathType(path_type=dir)], method: Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=True, strict=None, min_length=None, max_length=None, pattern=None)], attribute: str | None = None, weights_dset: str | None = None, parallel: bool = True, max_workers: Annotated[int, Gt(gt=0)] | None = None, neighbor_order: Annotated[int, Ge(ge=0)] = 0, buffer_distance: float = 0.0, where: str | None = None, dset_src: Annotated[Path, PathType(path_type=file)], dset_format: DatasetFormatEnum | None = None, dset_ext: str | None = None, crs: str | None = None, weights_dset_src: Annotated[Path, PathType(path_type=file)] | None = None)[source]#
Bases:
BaseModelStrictInputs for a single characterization entry in the CharacterizeConfig.
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
Check that attribute is provided for required methods and warn if attribute is provided for methods where it doesn't apply.
Check that the specified method is applicable to the input dset_format.
is_valid_method(value)Check that method is one of the allowable values.
Check that, if parallel is set to True or max_workers was provided, the selected method can be parallelized.
set_crs()Dynamically set the crs property.
Dynamically set the dset_ext property.
Dynamically set the the dset_source property.
Dynamically set the the dset_source property by joining input data_dir and dset.
Dynamically set the the weights_dset_src property by joining input data_dir and weights_dset.
Check that, if weights_dset is provided, the selected method is applicable to the method.
Check that entry for where does not contain any questionable code.
Attributes
model_computed_fieldsConfiguration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Get extra fields set during validation.
model_fieldsReturns the set of fields that have been explicitly set on this model instance.
dsetdata_dirmethodattributeweights_dsetparallelmax_workersneighbor_orderbuffer_distancewheredset_srcdset_formatdset_extcrsweights_dset_src- classmethod is_valid_method(value)[source]#
Check that method is one of the allowable values.
- Parameters:
value (str) – Input value
- Returns:
str – Output value
- Raises:
ValueError – A ValueError will be raised if the input method is invalid.
- set_dset_src()[source]#
Dynamically set the the dset_source property by joining input data_dir and dset.
- set_weights_dset_src()[source]#
Dynamically set the the weights_dset_src property by joining input data_dir and weights_dset.
- where_check()[source]#
Check that entry for where does not contain any questionable code. Also issues a warning if where is specified but doesn’t apply to the specified method.
- attribute_check()[source]#
Check that attribute is provided for required methods and warn if attribute is provided for methods where it doesn’t apply. Also ensure that the attribute is present in the input dataset and is a numeric datatype.
- Raises:
ValueError – A ValueError will be raised if attribute is missing for a required method or does not exist in the input dataset.
TypeError – A TypeError will be raised if the input attribute exists in the dataset but is not a numeric datatype.
- check_method_applicability()[source]#
Check that the specified method is applicable to the input dset_format.
- weights_dset_check()[source]#
Check that, if weights_dset is provided, the selected method is applicable to the method. If not, warn the user.
- parallel_check()[source]#
Check that, if parallel is set to True or max_workers was provided, the selected method can be parallelized. If not, warn the user.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].