Skip to content

Fix the Python exemples of string list parameters

Cédric Traizet requested to merge 2245_fix_stringlist_documentation into release-8.0

Summary

Closes #2245 (closed)

The generated Python exemples of ListView, Band and Field parameters are incorrect, for instance, the example corresponding to RadiometricIndices is:

import otbApplication

app = otbApplication.Registry.CreateApplication("RadiometricIndices")

app.SetParameterString("in", "qb_RoadExtract.tif")
app.SetParameterStringList("list", "Vegetation:NDVI Vegetation:RVI Vegetation:IPVI")
app.SetParameterString("out", "RadiometricIndicesImage.tif")

app.ExecuteAndWriteOutput()

But SetParameterStringList expects a list of string as second parameter. This Merge Request fixes the script generating the example to generate a list from the input values.

For the same application it now outputs:

import otbApplication

app = otbApplication.Registry.CreateApplication("RadiometricIndices")

app.SetParameterString("in", "qb_RoadExtract.tif")
app.SetParameterStringList("list", ['Vegetation:NDVI', 'Vegetation:RVI', 'Vegetation:IPVI'])
app.SetParameterString("out", "RadiometricIndicesImage.tif")

app.ExecuteAndWriteOutput()

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Edited by Cédric Traizet

Merge request reports

Loading