s1tiling.libs.otbpipeline.PipelineDescriptionSequence
- class s1tiling.libs.otbpipeline.PipelineDescriptionSequence(cfg: DomainConfiguration, dryrun: bool, debug_caches: bool)[source]
Bases:
Generic[DomainConfiguration]This class is the main entry point to describe pipelines.
Internally, it can be seen as a list of
PipelineDescriptionobjects.New methods & Specialized methods
__init__Constructor.
_build_dependenciesRuns the inputs through all pipeline descriptions to build the full list of intermediary and final products and what they require to be built.
_build_tasks_from_dependenciesGenerates the actual list of tasks for
dask.client.get()._check_static_task_requirementsCheck all tasks have their requirement fulfilled for being generated.
_prepare_inputsTakes care of instanciating all
FirstStepswith the registeredFirstStepFactories.Generates the minimal list of tasks that can be passed to Dask
Registers extra parameters that will be passed to all the for
FirstStep factoriesregistered.Registers a
FirstStepFactorythat will act as a source ofFirstSteps.Registers a pipeline description from:
- generate_tasks(do_watch_ram=False) Tuple[Dict[str, Tuple | FirstStep], List[str], List[Outcome]][source]
Generates the minimal list of tasks that can be passed to Dask
- Parameters:
do_watch_ram (bool) – Debug oriented parameter used to watch RAM usage.
- Returns:
A tuple made of:
the dictionary of tasks
the list of expected final products
a list of observed errors (that could happen while instanciating
FirstSteps
- Todo:
Move into another dedicated class instead of PipelineDescriptionSequence
- register_extra_parameters_for_input_factories(**extra) None[source]
Registers extra parameters that will be passed to all the for
FirstStep factoriesregistered.e.g.
pipelines.register_extra_parameters_for_input_factories( dag=dag, s1_file_manager=s1_file_manager, dryrun=dryrun, )
- register_inputs(kind: str, first_steps_factory: FirstStepFactory) None[source]
Registers a
FirstStepFactorythat will act as a source ofFirstSteps.- Parameters:
first_steps_factory (FirstStepFactory) – Hook that’ll build
FirstStepson the fly from the registeredDomainConfigurationand theregistered extra parameters.
Note
This will permit to extend the list of starting inputs without having to modify main source code.
- register_pipeline(factory_steps: List[Type], *args, **kwargs) PipelineDescription[source]
Registers a pipeline description from:
- Parameters:
factory_steps (list(type)) – List of non-instanciated
StepFactoryclasses.name (Optional[str]) – Optional name for the pipeline.
product_required (bool) – Tells whether the pipeline product is expected as a final product – and not an intermediary product.
is_name_incremental (bool) – Tells whether expected filename needs evaluations of each intermediary steps of whether it can be directly deduced from the last step.
- Returns:
The
PipelineDescriptionbuilt.