Skip to content

Resolve "Migration guide pyotb 1.5.4 --> 2.0.0"

Rémi Cresson requested to merge 104-migration into develop

Closes #104 (closed)

I took the liberty to add OTBObject.summarize() for backward compatibility purpose, and also convenience (this way the API is more flexible). However I am open to discuss its non-return, not a big deal.

Basically this MR consists in new decorators (in deprecated.py) for the depreciation of methods, arguments, and the otbObject class. Flashy color warning appear to suggest user to replace arguments names, when it's backward compatible, and exception are thrown (DepreciationWarning) when it's not. I have brought back the App.__getattr__ only to throw a DepreciationWarning explaining how to migrate, when the App.app attribute exists.

Maybe I have missed a few old attributes. With the decorators we can add them for depreciation easily.

to do

  • add warnings and depreciation decorators in code
  • write a note on migration in documentation
Edited by Rémi Cresson

Merge request reports