s1tiling.libs.steps.Store

class s1tiling.libs.steps.Store(appname: str, *argv, **kwargs)[source]

Bases: StepFactory

Factory for Artificial Step that forces the result of the previous app sequence to be stored on disk by breaking in-memory connection.

While it could be used manually, it’s meant to be automatically appended at the end of a pipeline if any step is actually related to OTB.

New methods & Specialized methods

__init__

build_step_output_filename

Deleted method: No way to ask for the output filename of a Store Factory

build_step_output_tmp_filename

Deleted method: No way to ask for the output temporary filename of a Store Factory

create_step

Specializes StepFactory.create_step() to trigger StoreStep.execute_and_write_output() on the last step that relates to an OTB Application.

Methods inherited from parent

complete_meta

Duplicates, completes, and returns, the meta dictionary with specific information for the current factory regarding Step instanciation.

update_filename_meta

Duplicates, completes, and returns, the meta dictionary with specific information for the current factory regarding tasks analysis.

check_requirements

Abstract method used to test whether a StepFactory has all its external requirements fulfilled.

update_image_metadata

Root implementation of update_image_metadata() that shall be specialized in every file producing Step Factory.

Attributes and properties

image_description

Property image_description, used to fill TIFFTAG_IMAGEDESCRIPTION

name

Step Name property.

_do_create_actual_step(execution_parameters: Dict, input_step: AbstractStep, meta: Dict) AbstractStep

Generic variation point for the exact step creation. The default implementation returns a new AbstractStep.

_update_filename_meta_post_hook(meta: Dict) None

Hook meant to be overridden to fix product metadata by overriding their default definition.

Called from update_filename_meta()

_update_filename_meta_pre_hook(meta: Dict) Dict

Hook meant to be overridden to complete product metadata before they are used to produce filenames or tasknames.

Called from update_filename_meta()

build_step_output_filename(meta: Dict) NoReturn[source]

Deleted method: No way to ask for the output filename of a Store Factory

build_step_output_tmp_filename(meta: Dict) NoReturn[source]

Deleted method: No way to ask for the output temporary filename of a Store Factory

check_requirements() Tuple[str, str] | None

Abstract method used to test whether a StepFactory has all its external requirements fulfilled. For instance, OTBStepFactory’s will check their related OTB application can be executed.

Returns:

None if requirements are fulfilled.

Returns:

A message indicating what is missing otherwise, and some context how to fix it.

complete_meta(meta: Dict, all_inputs: List[Dict[str, AbstractStep]]) Dict

Duplicates, completes, and returns, the meta dictionary with specific information for the current factory regarding Step instanciation.

create_step(execution_parameters: Dict, previous_steps: List[List[Dict[str, AbstractStep]]]) AbstractStep | StoreStep[source]

Specializes StepFactory.create_step() to trigger StoreStep.execute_and_write_output() on the last step that relates to an OTB Application.

In case the input step is a first step, we simply return a AbstractStep. Indeed StoreStep doesn’t transform anything: it just makes sure the registered transformations have been applied.

Eventually, it makes sure all the OTB applications have been released with Step.release_app().

property image_description: str

Property image_description, used to fill TIFFTAG_IMAGEDESCRIPTION

property name: str

Step Name property.

update_filename_meta(meta: Dict) Dict

Duplicates, completes, and returns, the meta dictionary with specific information for the current factory regarding tasks analysis.

This method is used:

  • while analysing the dependencies to build the task graph – in this use case the relevant information are the file names and paths.

  • and indirectly before instanciating a new Step

Other metadata not filled here:

  • get_task_name() which is deduced from out_filename by default

  • out_extended_filename_complement()

It’s possible to inject some other metadata (that could be used from _get_canonical_input() for instance) thanks to _update_filename_meta_pre_hook().

This method is not meant to be overridden. Instead it implements the template method design pattern, and expects the customization to be done through the specialization of the hooks:

update_image_metadata(meta: Dict, all_inputs: List[Dict[str, AbstractStep]]) None

Root implementation of update_image_metadata() that shall be specialized in every file producing Step Factory.