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

Inherit docstrings for bounding_box on subclasses #4265

Open
embray opened this issue Oct 22, 2015 · 0 comments
Open

Inherit docstrings for bounding_box on subclasses #4265

embray opened this issue Oct 22, 2015 · 0 comments

Comments

@embray
Copy link
Member

embray commented Oct 22, 2015

As noted in #4264, when a Model subclass defined the bounding_box property or method, if it has its own docstring that docstring ends up being lost--this is because of how the metaclass swallows the bounding_box member of the subclass and replaces it with the base Model.bounding_box property.
See for example Gaussian2D.

This actually has two negative effects:

  1. Gaussian2D.bounding_box.__doc__ displays the docstring for Model.bounding_box, not
    the docstring for Gaussian2D.bounding_box.
  2. It is impossible to reference Gaussian2D.bounding_box in Sphinx. It results in a missing reference.
    For example this line was originally a direct reference, but it didn't work. That should be fixed.

This is just a documentation issue, but is worth fixing. I think it can be fixed by slightly going back on some of my changes in #4236 and make it so that each subclass does get its own property object in its __dict__ for bounding_box, rather than just referring directly to Model.property. It's slightly wasteful, but only slightly.

@embray embray added this to the v1.1.1 milestone Oct 22, 2015
@embray embray self-assigned this Oct 22, 2015
@embray embray modified the milestones: v1.1.1, v1.1.2 Jan 7, 2016
@eteq eteq modified the milestones: v1.1.3, v1.1.2 Mar 10, 2016
@astrofrog astrofrog removed this from the v1.1.3 milestone May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants