
Hi Richard, On April 8, 2019 18:58:37 richard@rdg.cc wrote:
Firstly, the way the methods are made into property methods (i.e. what would normally be simply declared with the @property decorator) is strange. This is currently done by running through the class dir and adding the properties; more strangely the code to do this is burred in a method which also programmatically re-factors the doc strings. This method is set to run only when __debug__ is defined, which means that if python happens to be run with the -O flag, then any code which uses regionprops in the conventional manner (including all unit tests) will fail in a very confusing way.
I think you are right that the property setters should execute in debug mode as well. The function that handles that currently conflates docstrings and property conversion. The principle here is that a piece of information (such as a docstring) should exist in only one place. But other than that, I think there is a lot of room for improvement and to clarify the code---so your contribution will be most welcome. Best regards, Stéfan