Format code differently?
I am in favor to change the code style. I don't know how python gurus call this, but I would like that pyotb adopts a new coding style for the 2.x release (see example below). It might produce more lines of code, but I prefer the look especially in the documentation snippets! Basically, short line length (79) + breaking 1 parameter / line when the whole line is over 79 chars...
current
import pyotb
resampled = pyotb.RigidTransformResample({'in': 'my_image.tif', 'interpolator': 'linear',
'transform.type.id.scaley': 0.5, 'transform.type.id.scalex': 0.5})
calibrated = pyotb.OpticalCalibration({'in': resampled, 'level': 'toa'})
dilated = pyotb.BinaryMorphologicalOperation({'in': calibrated, 'out': 'output.tif', 'filter': 'dilate',
'structype': 'ball', 'xradius': 3, 'yradius': 3})
dilated.write('result.tif')
proposed
import pyotb
resampled = pyotb.RigidTransformResample({
"in": "my_image.tif",
"interpolator": "linear",
"transform.type.id.scaley": 0.5,
"transform.type.id.scalex": 0.5
})
calibrated = pyotb.OpticalCalibration({"in": resampled, "level": "toa"})
dilated = pyotb.BinaryMorphologicalOperation({
"in": calibrated,
"out": "output.tif",
"filter": "dilate",
"structype": "ball",
"xradius": 3,
"yradius": 3
})
dilated.write('result.tif')