Data Model

Config

Contains Pydantic Hydra configuration data models.

Several Pydantic composable configuration data models have been defined within this module for integration with Hydra Core and OmegaConf.

class deeprootgen.data_model.config_data_models.ExperimentModel(*, name_prefix: str, tracking_uri: str, insecure_tls: str, enabled: bool)[source]

The experiment data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'enabled': FieldInfo(annotation=bool, required=True), 'insecure_tls': FieldInfo(annotation=str, required=True), 'name_prefix': FieldInfo(annotation=str, required=True), 'tracking_uri': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.config_data_models.FormModel(*, components: Dict[str, dict])[source]

The form data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'components': FieldInfo(annotation=Dict[str, dict], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.config_data_models.ObjectStorageModel(*, s3_ignore_tls: str, s3_endpoint_url: str, aws_access_key_id: str, aws_secret_access_key: str, enabled: bool)[source]

The object storage data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'aws_access_key_id': FieldInfo(annotation=str, required=True), 'aws_secret_access_key': FieldInfo(annotation=str, required=True), 'enabled': FieldInfo(annotation=bool, required=True), 's3_endpoint_url': FieldInfo(annotation=str, required=True), 's3_ignore_tls': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.config_data_models.OrchestrationModel(*, api_url: str, api_enable_http2: str, api_tls_insecure_skip_verify: str, enabled: bool)[source]

The orchestration data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'api_enable_http2': FieldInfo(annotation=str, required=True), 'api_tls_insecure_skip_verify': FieldInfo(annotation=str, required=True), 'api_url': FieldInfo(annotation=str, required=True), 'enabled': FieldInfo(annotation=bool, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

Simulation

Contains Pydantic data models for the simulation

Several Pydantic data models are defined for different root system architecture simulation procedures.

class deeprootgen.data_model.simulation_data_models.ParameterIntervalModel(*, lower_bound: float, upper_bound: float, data_type: str)[source]

The parameter specification data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'data_type': FieldInfo(annotation=str, required=True), 'lower_bound': FieldInfo(annotation=float, required=True), 'upper_bound': FieldInfo(annotation=float, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.simulation_data_models.RootCalibrationIntervals(*, max_order: ParameterIntervalModel, root_ratio: ParameterIntervalModel, fine_root_threshold: ParameterIntervalModel, outer_root_num: ParameterIntervalModel, inner_root_num: ParameterIntervalModel, min_primary_length: ParameterIntervalModel, max_primary_length: ParameterIntervalModel, base_diameter: ParameterIntervalModel, diameter_reduction: ParameterIntervalModel, apex_diameter: ParameterIntervalModel, min_sec_root_num: ParameterIntervalModel, max_sec_root_num: ParameterIntervalModel, growth_sec_root: ParameterIntervalModel, min_sec_root_length: ParameterIntervalModel, max_sec_root_length: ParameterIntervalModel, segments_per_root: ParameterIntervalModel, length_reduction: ParameterIntervalModel, root_vary: ParameterIntervalModel, interbranch_distance: ParameterIntervalModel, mechanical_constraints: ParameterIntervalModel, root_tissue_density: ParameterIntervalModel, gravitropism: ParameterIntervalModel, t: ParameterIntervalModel)[source]

The root system architecture calibration interval data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'apex_diameter': FieldInfo(annotation=ParameterIntervalModel, required=True), 'base_diameter': FieldInfo(annotation=ParameterIntervalModel, required=True), 'diameter_reduction': FieldInfo(annotation=ParameterIntervalModel, required=True), 'fine_root_threshold': FieldInfo(annotation=ParameterIntervalModel, required=True), 'gravitropism': FieldInfo(annotation=ParameterIntervalModel, required=True), 'growth_sec_root': FieldInfo(annotation=ParameterIntervalModel, required=True), 'inner_root_num': FieldInfo(annotation=ParameterIntervalModel, required=True), 'interbranch_distance': FieldInfo(annotation=ParameterIntervalModel, required=True), 'length_reduction': FieldInfo(annotation=ParameterIntervalModel, required=True), 'max_order': FieldInfo(annotation=ParameterIntervalModel, required=True), 'max_primary_length': FieldInfo(annotation=ParameterIntervalModel, required=True), 'max_sec_root_length': FieldInfo(annotation=ParameterIntervalModel, required=True), 'max_sec_root_num': FieldInfo(annotation=ParameterIntervalModel, required=True), 'mechanical_constraints': FieldInfo(annotation=ParameterIntervalModel, required=True), 'min_primary_length': FieldInfo(annotation=ParameterIntervalModel, required=True), 'min_sec_root_length': FieldInfo(annotation=ParameterIntervalModel, required=True), 'min_sec_root_num': FieldInfo(annotation=ParameterIntervalModel, required=True), 'outer_root_num': FieldInfo(annotation=ParameterIntervalModel, required=True), 'root_ratio': FieldInfo(annotation=ParameterIntervalModel, required=True), 'root_tissue_density': FieldInfo(annotation=ParameterIntervalModel, required=True), 'root_vary': FieldInfo(annotation=ParameterIntervalModel, required=True), 'segments_per_root': FieldInfo(annotation=ParameterIntervalModel, required=True), 't': FieldInfo(annotation=ParameterIntervalModel, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.simulation_data_models.RootCalibrationModel(*, random_seed: int | None, parameter_intervals: RootCalibrationIntervals, calibration_parameters: Dict[str, bool | float | int | str], summary_statistics: List[SummaryStatisticsModel] | None = None, observed_data: List[RootNodeModel] | None = None, observed_data_content: str | None = '', raw_edge_content: str | None = '', statistics_comparison: StatisticsComparisonModel | None = None, origin_min: float | None = 0.001, origin_max: float | None = 0.01, enable_soil: bool | None = False, soil_layer_height: float | None = 0, soil_layer_width: float | None = 0, soil_n_layers: int | None = 0, soil_n_cols: int | None = 0, max_val_attempts: int | None = 50, simulation_tag: str | None = 'default', no_root_zone: float | None = 0.0001, floor_threshold: float | None = 0.4, ceiling_threshold: float | None = 0.9)[source]

The root system architecture calibration data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'calibration_parameters': FieldInfo(annotation=Dict[str, Union[bool, float, int, str]], required=True), 'ceiling_threshold': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.9), 'enable_soil': FieldInfo(annotation=Union[bool, NoneType], required=False, default=False), 'floor_threshold': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.4), 'max_val_attempts': FieldInfo(annotation=Union[int, NoneType], required=False, default=50), 'no_root_zone': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0001), 'observed_data': FieldInfo(annotation=Union[List[RootNodeModel], NoneType], required=False, default=None), 'observed_data_content': FieldInfo(annotation=Union[str, NoneType], required=False, default=''), 'origin_max': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.01), 'origin_min': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.001), 'parameter_intervals': FieldInfo(annotation=RootCalibrationIntervals, required=True), 'random_seed': FieldInfo(annotation=Union[int, NoneType], required=True), 'raw_edge_content': FieldInfo(annotation=Union[str, NoneType], required=False, default=''), 'simulation_tag': FieldInfo(annotation=Union[str, NoneType], required=False, default='default'), 'soil_layer_height': FieldInfo(annotation=Union[float, NoneType], required=False, default=0), 'soil_layer_width': FieldInfo(annotation=Union[float, NoneType], required=False, default=0), 'soil_n_cols': FieldInfo(annotation=Union[int, NoneType], required=False, default=0), 'soil_n_layers': FieldInfo(annotation=Union[int, NoneType], required=False, default=0), 'statistics_comparison': FieldInfo(annotation=Union[StatisticsComparisonModel, NoneType], required=False, default=None), 'summary_statistics': FieldInfo(annotation=Union[List[SummaryStatisticsModel], NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.simulation_data_models.RootEdgeModel(*, parent_id: int, child_id: int)[source]

The edge data model for the hierarchical graph representation of the root system.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'child_id': FieldInfo(annotation=int, required=True), 'parent_id': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.simulation_data_models.RootNodeModel(*, node_id: int | None = 0, plant_id: int | None = 1, parent_id: int | None = -1, organ_id: int | None = 0, x: float | None = 0.0, y: float | None = 0.0, z: float | None = 0.0, order: int | None = 0, segment_rank: int | None = 0, diameter: float | None = 0.0, length: float | None = 0.0, root_tissue_density: float | None = 0.0, root_type: str | None = 'base', order_type: str | None = 'base', position_type: str | None = 'base', simulation_tag: str | None = 'default', invalid_root: bool | None = False)[source]

The node data model for the hierarchical graph representation of the root system.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'diameter': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0), 'invalid_root': FieldInfo(annotation=Union[bool, NoneType], required=False, default=False), 'length': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0), 'node_id': FieldInfo(annotation=Union[int, NoneType], required=False, default=0), 'order': FieldInfo(annotation=Union[int, NoneType], required=False, default=0), 'order_type': FieldInfo(annotation=Union[str, NoneType], required=False, default='base'), 'organ_id': FieldInfo(annotation=Union[int, NoneType], required=False, default=0), 'parent_id': FieldInfo(annotation=Union[int, NoneType], required=False, default=-1), 'plant_id': FieldInfo(annotation=Union[int, NoneType], required=False, default=1), 'position_type': FieldInfo(annotation=Union[str, NoneType], required=False, default='base'), 'root_tissue_density': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0), 'root_type': FieldInfo(annotation=Union[str, NoneType], required=False, default='base'), 'segment_rank': FieldInfo(annotation=Union[int, NoneType], required=False, default=0), 'simulation_tag': FieldInfo(annotation=Union[str, NoneType], required=False, default='default'), 'x': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0), 'y': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0), 'z': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.simulation_data_models.RootSimulationModel(*, random_seed: int | None, max_order: int, root_ratio: float, fine_root_threshold: float, outer_root_num: int, inner_root_num: int, min_primary_length: float, max_primary_length: float, base_diameter: float, diameter_reduction: float, apex_diameter: float, min_sec_root_num: int, max_sec_root_num: int, growth_sec_root: float, min_sec_root_length: float, max_sec_root_length: float, segments_per_root: int, length_reduction: float, root_vary: float, interbranch_distance: float, mechanical_constraints: float, root_tissue_density: float, gravitropism: float, t: int, origin_min: float | None = 0.001, origin_max: float | None = 0.01, enable_soil: bool | None = False, soil_layer_height: float | None = 0, soil_layer_width: float | None = 0, soil_n_layers: int | None = 0, soil_n_cols: int | None = 0, max_val_attempts: int | None = 50, simulation_tag: str | None = 'default', no_root_zone: float | None = 0.0001, floor_threshold: float | None = 0.4, ceiling_threshold: float | None = 0.9)[source]

The root system architecture simulation data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'apex_diameter': FieldInfo(annotation=float, required=True), 'base_diameter': FieldInfo(annotation=float, required=True), 'ceiling_threshold': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.9), 'diameter_reduction': FieldInfo(annotation=float, required=True), 'enable_soil': FieldInfo(annotation=Union[bool, NoneType], required=False, default=False), 'fine_root_threshold': FieldInfo(annotation=float, required=True), 'floor_threshold': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.4), 'gravitropism': FieldInfo(annotation=float, required=True), 'growth_sec_root': FieldInfo(annotation=float, required=True), 'inner_root_num': FieldInfo(annotation=int, required=True), 'interbranch_distance': FieldInfo(annotation=float, required=True), 'length_reduction': FieldInfo(annotation=float, required=True), 'max_order': FieldInfo(annotation=int, required=True), 'max_primary_length': FieldInfo(annotation=float, required=True), 'max_sec_root_length': FieldInfo(annotation=float, required=True), 'max_sec_root_num': FieldInfo(annotation=int, required=True), 'max_val_attempts': FieldInfo(annotation=Union[int, NoneType], required=False, default=50), 'mechanical_constraints': FieldInfo(annotation=float, required=True), 'min_primary_length': FieldInfo(annotation=float, required=True), 'min_sec_root_length': FieldInfo(annotation=float, required=True), 'min_sec_root_num': FieldInfo(annotation=int, required=True), 'no_root_zone': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0001), 'origin_max': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.01), 'origin_min': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.001), 'outer_root_num': FieldInfo(annotation=int, required=True), 'random_seed': FieldInfo(annotation=Union[int, NoneType], required=True), 'root_ratio': FieldInfo(annotation=float, required=True), 'root_tissue_density': FieldInfo(annotation=float, required=True), 'root_vary': FieldInfo(annotation=float, required=True), 'segments_per_root': FieldInfo(annotation=int, required=True), 'simulation_tag': FieldInfo(annotation=Union[str, NoneType], required=False, default='default'), 'soil_layer_height': FieldInfo(annotation=Union[float, NoneType], required=False, default=0), 'soil_layer_width': FieldInfo(annotation=Union[float, NoneType], required=False, default=0), 'soil_n_cols': FieldInfo(annotation=Union[int, NoneType], required=False, default=0), 'soil_n_layers': FieldInfo(annotation=Union[int, NoneType], required=False, default=0), 't': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.simulation_data_models.RootType(value)[source]

An enumeration.

class deeprootgen.data_model.simulation_data_models.RootTypeModel(*, root_type: str, order_type: str, position_type: str)[source]

The root type data model for classifying roots.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'order_type': FieldInfo(annotation=str, required=True), 'position_type': FieldInfo(annotation=str, required=True), 'root_type': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.simulation_data_models.StatisticsComparisonModel(*, summary_statistics: List[str] | None = None, distance_metrics: List[str] | None = None, include_parameters: List[str] | None = None, exclude_parameters: List[str] | None = None, input_columns: List[str] | None = None, output_columns: List[str] | None = None, stat_by_soil_layer: bool | None = False, stat_by_soil_column: bool | None = False, use_summary_statistics: bool | None = True)[source]

The data model for comparing synthetic and observed data.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'distance_metrics': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None), 'exclude_parameters': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None), 'include_parameters': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None), 'input_columns': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None), 'output_columns': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None), 'stat_by_soil_column': FieldInfo(annotation=Union[bool, NoneType], required=False, default=False), 'stat_by_soil_layer': FieldInfo(annotation=Union[bool, NoneType], required=False, default=False), 'summary_statistics': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None), 'use_summary_statistics': FieldInfo(annotation=Union[bool, NoneType], required=False, default=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class deeprootgen.data_model.simulation_data_models.SummaryStatisticsModel(*, statistic_name: str, statistic_value: float, z_lower_bound: float | None = 0.0, z_upper_bound: float | None = 0.0)[source]

The summary statistics data model.

Args:
BaseModel (BaseModel):

The Pydantic Base model class.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'statistic_name': FieldInfo(annotation=str, required=True), 'statistic_value': FieldInfo(annotation=float, required=True), 'z_lower_bound': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0), 'z_upper_bound': FieldInfo(annotation=Union[float, NoneType], required=False, default=0.0)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.