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

class methods do not have doc pages #1055

Closed
wholmgren opened this issue Sep 8, 2020 · 5 comments · Fixed by #1075
Closed

class methods do not have doc pages #1055

wholmgren opened this issue Sep 8, 2020 · 5 comments · Fixed by #1075

Comments

@wholmgren
Copy link
Member

Describe the bug
Many PVSystem class methods do not have doc pages.

To Reproduce
Go to the PVSystem doc page, notice that many methods don't have links.

Versions:

  • pvlib.__version__: 0.8.0b0

A of couple of approaches to consider:

Might try adding sphinx 3.1 :recursive: option here. There's some compatibility reason we're on an older version of sphinx (maybe a sphinx gallery issue?).

Modify the sphinx autosummary class template.

Manually document the methods in api.rst. We should be doing this anyways.

@veronicaguo
Copy link
Contributor

Hi @wholmgren , I'd be happy to take a stab at this.

@wholmgren
Copy link
Member Author

@veronicaguo thanks! No preference here on the approach - could be one of the ideas in my initial comment or could be something else.

@kandersolar
Copy link
Member

There's some compatibility reason we're on an older version of sphinx (maybe a sphinx gallery issue?).

See #911 (comment), it was because of poor formatting in the sphinx 2.x html output and nuisance warnings. Looks like a lot of development has gone into Sphinx since February, so if we want to start using sphinx features added after 1.8.5, it's probably worth trying out the current release again!

@veronicaguo
Copy link
Contributor

veronicaguo commented Oct 5, 2020

So I tried a few things...

  • Sphinx 3.1.2 seems to work well now. It doesn't output any warnings, and the format looks very much like the existing docs except tighter line spacing for class methods descriptions.
  • Adding :recursive to api.rst doesn't create the links, but adding the following after .. autosummary:: in methods block in class template does work.
          :toctree:
          :recursive:
    
    • The downside is that it generates a full toctree for each class, so will create duplicate links for methods that are grouped already, like PVSystem.get_aoi.
  • Manually document the methods in api.rst works as expected, consistent with the current doc structure. Need to add methods in SingleAxisTracker class too.

wondering what's the preference here between the two approaches, and if we want to upgrade sphinx to the latest release.

@cwhanse
Copy link
Member

cwhanse commented Oct 5, 2020

Duplicate links don't bother me. If someone is looking up a method, they may be asking "what can I do with PVSystem" or they could be asking "what are the options for the _____ model"?

If I understand correct, we either add :recursive: where a Class appears in api.rst, or, we add an line for every class method. Either one would be maintainable for those who need a pattern to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants