How To’s…
How to add a new processing?
This is done by deriving from StepFactory
, or from OTBStepFactory
. You’ll find many examples in the
default step factories.
The important points are to decide:
Where should the step happen in the sequence of pipelines?
In all cases, don’t forget to add it in a pipeline registered in the sequence of pipelines.Shall its result be considered as a public product, or an intermediary step?
A public product is expected to be always produced. It shall then conclude a pipeline. Also the pipeline shall be registered withproduct_required=True
in that case.What would be the name of the result files?
Overridebuild_step_output_filename()
with the answer.Note
Even if there is no OTB application behind the step, this method needs to forward the filename of the input as done in
AnalyseBorders.build_step_output_filename()
.Which configuration options would be needed?
Copy them from the constructor that will be passed thes1tiling.libs.configuration.Configuration
object.What meta information should be filled-in?
This should be done incomplete_meta()
.
Meta information can be used:immediately by other methods like
parameters()
,or by later steps in the pipeline.
If there is an OTB application behind the step – which should be the case for most processing steps.
In case the step relates to an OTB application:
What parameters shall be sent to the OTB application?
Return the information fromparameters()
.What are the parameters expected by the OTB application from the images that could be passed in-memory?
The default are"in"
and"out"
but could be overridden in the constructor of the new step factory through the parametersparam_in
andparam_out
. See for instances1tiling.libs.otbwrappers.OrthoRectify.__init__()
implementation.What is the OTB application?
Its name is expected to be passed to the constructor of the parent class, from the constructor of the new class.
Note
Most of the time, inheriting of OTBStepFactory
is the best choice. Still, it’s
possible to take over and to manually answer the following questions:
What would be the name of the temporary files while they are being produced?
Return the information frombuild_step_output_tmp_filename()
,Where the product should be produced?
Return the information fromoutput_directory()
– this is typically used frombuild_step_output_filename()
.
Technically all other methods from StepFactory
could be overridden. For instance,
create_step()
could
be overridden to change the type of Steps instantiated.
Release a new version
Here is a short list of the actions to do for each new release.
Update the release notes
Make sure
__meta__.py
version matches the name of the version to be released. Don’t forget the rcX suffix if need be.
Version format is expected to follow the following convention:
M.m(.p)(rcX)
See https://packaging.python.org/guides/distributing-packages-using-setuptools/#standards-compliance-for-interoperabilityLet’s extract version number into a variable to simplify following steps
version="$(awk '/version/ {print $3}' s1tiling/__meta__.py | xargs )" echo "version: ${version}"
Handle all the issues associated for the related milestone.
Push
develop
branch.git checkout develop && git push
Merge
develop
branch intomaster
git checkout master && git merge develop
Push
master
branch.git checkout master && git push
6 Create a git tag matching the version number
git tag -a "${version}" # And fill in version information
Push the tag
git push --tags
Note
From there on, the CI will automatically take care of registering the source distribution (only; and not the wheel!) on pypi as if we had manually ran
# Prepare the packets for pipy python3 setup.py sdist # Push to pipy python3 -m twine upload --repository pypi dist/S1Tiling-${version}*
- Update
__meta__.py
version to the next expected version. Do not use the rcX suffix for the moment.
- Update