eogrow.pipelines.testing

Implements pipelines used for data preparation in testing.

pydantic model eogrow.pipelines.testing.UniformDistributionSchema[source]

Bases: Schema

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

Raises ValidationError if the input data cannot be parsed to form a valid model.

Fields:
field kind: Literal['uniform'] [Required]
field max_value: float = 1

All values in the feature will be smaller or equal than this value.

field min_value: float = 0

All values in the feature will be greater or equal to this value.

pydantic model eogrow.pipelines.testing.NormalDistributionSchema[source]

Bases: Schema

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

Raises ValidationError if the input data cannot be parsed to form a valid model.

Fields:
field kind: Literal['normal'] [Required]
field mean: float = 0

Mean of the normal distribution.

field std: float = 1

Standard deviation of the normal distribution.

pydantic model eogrow.pipelines.testing.RasterFeatureGenerationSchema[source]

Bases: Schema

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

Raises ValidationError if the input data cannot be parsed to form a valid model.

Fields:
field distribution: UniformDistributionSchema | NormalDistributionSchema [Required]

Choice of distribution for generating values.

field dtype: dtype [Required]

The output dtype of the feature

Validated by:
field feature: Tuple[FeatureType, str] [Required]

Feature to be created.

field shape: Tuple[int, ...] [Required]

Shape of the feature

pydantic model eogrow.pipelines.testing.TimestampGenerationSchema[source]

Bases: Schema

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

Raises ValidationError if the input data cannot be parsed to form a valid model.

Fields:
field num_timestamps: int [Required]

Number of timestamps from the interval

field same_for_all: bool = True

Whether all EOPatches should have the same timestamps

field time_period: Tuple[date, date] [Required]

Time period from where timestamps will be generated.

Validated by:
class eogrow.pipelines.testing.GenerateDataPipeline(config, raw_config=None)[source]

Bases: Pipeline

Pipeline for generating test input data.

Parameters:
  • config (Schema) – A dictionary with configuration parameters

  • raw_config (RawConfig | None) – The configuration parameters pre-validation, for logging purposes only

pydantic model Schema[source]

Bases: Schema

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

Raises ValidationError if the input data cannot be parsed to form a valid model.

Fields:
  • features (List[eogrow.pipelines.testing.RasterFeatureGenerationSchema])

  • meta_info (dict | None)

  • output_folder_key (str)

  • seed (int)

  • timestamps (eogrow.pipelines.testing.TimestampGenerationSchema | None)

field features: List[RasterFeatureGenerationSchema] [Optional]

A specification for features to be generated.

field meta_info: dict | None = None

Information to be stored into the meta-info fields of each EOPatch.

field output_folder_key: str [Required]

The storage manager key pointing to the pipeline output folder.

Validated by:
  • validate_storage_key

field seed: int [Required]

A seed with which per-eopatch RNGs seeds are generated.

field timestamps: TimestampGenerationSchema | None = None
config: Schema
build_workflow()[source]

Creates a workflow with tasks that generate different types of features and tasks that join and save the final EOPatch.

Return type:

EOWorkflow

get_execution_arguments(workflow, patch_list)[source]

Extends the basic method for adding execution arguments by adding seed arguments a sampling task

Parameters:
  • workflow (EOWorkflow) –

  • patch_list (List[Tuple[str, BBox]]) –

Return type:

Dict[str, Dict[EONode, Dict[str, object]]]