Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-22207:Update doc string to specify this works on classes as well as functio… #77

Merged
merged 7 commits into from Dec 7, 2019

Conversation

leannep
Copy link
Member

@leannep leannep commented Nov 13, 2019

No description provided.

Copy link
Member

@jonathansick jonathansick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the summary sentence is updated, I wonder if the rest of the docstrings also needs some treatment?

For instance, add an example of deprecating a class?

Note that the syntax for the example in this docstring is also wrong (from before). It should be:

Examples
--------
.. code-block:: python

   ExposureF.getCalib = deprecate_pybind11(ExposureF.getCalib,
       reason="Replaced by getPhotoCalib. (Will be removed in 18.0)",
       category=FutureWarning))

(pluralization of "Examples" and the code-block to style the example)

python/lsst/utils/deprecated.py Show resolved Hide resolved
Copy link
Member

@jonathansick jonathansick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again, because deprecate_pybind11 isn't a decorator, we should document the func parameter, and perhaps rename it so something more general like obj.

Parameters
----------
obj : function, method, or class
    The function, method, or class to deprecate.

I would also recommend renaming the func parameter to obj.

@leannep leannep merged commit 2d13df8 into master Dec 7, 2019
@timj timj deleted the tickets/DM-22207 branch January 3, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants