Missing OTB applications parameters in summarize()
summarize()
tests have been changed in !68 (merged).
The following tests were used before the MR:
def test_pipeline_simple():
# BandMath -> OrthoRectification -> ManageNoData
app1 = pyotb.BandMath({'il': [FILEPATH], 'exp': 'im1b1'})
app2 = pyotb.OrthoRectification({'io.in': app1})
app3 = pyotb.ManageNoData({'in': app2})
summary = app3.summarize()
reference = {'name': 'ManageNoData', 'parameters': {'in': {
'name': 'OrthoRectification', 'parameters': {'io.in': {
'name': 'BandMath', 'parameters': {'il': (FILEPATH,), 'exp': 'im1b1'}},
'map': 'utm',
'outputs.isotropic': True}},
'mode': 'buildmask'}}
assert summary == reference
def test_pipeline_diamond():
# Diamond graph
app1 = pyotb.BandMath({'il': [FILEPATH], 'exp': 'im1b1'})
app2 = pyotb.OrthoRectification({'io.in': app1})
app3 = pyotb.ManageNoData({'in': app2})
app4 = pyotb.BandMathX({'il': [app2, app3], 'exp': 'im1+im2'})
summary = app4.summarize()
reference = {'name': 'BandMathX', 'parameters': {'il': [
{'name': 'OrthoRectification', 'parameters': {'io.in': {
'name': 'BandMath', 'parameters': {'il': (FILEPATH,), 'exp': 'im1b1'}},
'map': 'utm',
'outputs.isotropic': True}},
{'name': 'ManageNoData', 'parameters': {'in': {
'name': 'OrthoRectification', 'parameters': {
'io.in': {'name': 'BandMath', 'parameters': {'il': (FILEPATH,), 'exp': 'im1b1'}},
'map': 'utm',
'outputs.isotropic': True}},
'mode': 'buildmask'}}
],
'exp': 'im1+im2'}}
assert summary == reference
We can observe that default parameters were not summarized.
A work around for reproductible results can rely on the specific OTB version used at summarize()
time. But of course it would be better to have them in the summary (... if those parameters are actually used!)
Now in the current implementation, summarize()
returns many things, among which unused parameters, and also it misses some used parameters (mode
for ManageNoData for instance). So there is something to fix in the code.
Question: can we summarize all used parameters? Do the python API allow us to do that that?
Edited by Rémi Cresson