luispedro / mahotas

Computer Vision in Python
https://mahotas.rtfd.io
Other
844 stars 148 forks source link

pydoc mahotas.regmax (locmax, etc.) gives the wrong signature. #53

Closed anntzer closed 9 years ago

anntzer commented 9 years ago

Something weird is going on here:

$ pydoc mahotas.regmax | head -n4
Help on function regmax in mahotas:

mahotas.regmax = regmax(f, Bc=None, out=None, output=None)
    filtered = regmax(f, Bc={3x3 cross}, out={np.empty(f.shape, bool)})

At least one of the two lines is wrong...

luispedro commented 9 years ago

The first line is the actual interface, the second one is the public interface. output is a deprecated synonym for out. It works, but you get a warning (if you have deprecation warnings turned on), but it should not be used.

I don't really know how to handle this situation, though.

anntzer commented 9 years ago

Can you just remove output from the documented signature, or is it autogenerated?

luispedro commented 9 years ago

It is auto-generated, which is the problem. I want it in the code, but hidden from the users. The only point is to support older code.

(btw, the reason to use out is that that is what numpy/scipy uses; so it's best to be consistent within the community).

anntzer commented 9 years ago

I know about out. It's no big deal, just slightly confusing for the users of pydoc. Perhaps document output as a deprecated argument under the Parameters section?

luispedro commented 9 years ago

yes, I think that may be the best solution.