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

Add examples to docstrings #62

Open
bmu opened this issue Apr 30, 2015 · 6 comments
Open

Add examples to docstrings #62

bmu opened this issue Apr 30, 2015 · 6 comments

Comments

@bmu
Copy link
Contributor

bmu commented Apr 30, 2015

We should decide whether we want to add examples to the docstrings of the functions or not.
While (I think) examples are not included in every pandas object, they are in numpy. numpydoc has an optional section for examples.

I would like to include examples and also I would like to use doctests.
For the moment we have some examples, but some doctests fail
(see output of nosetests -v -w pvlib --with-coverage --cover-package=pvlib --with-doctest).
I once had a discussion with pandas developers (see pandas-dev/pandas#3439) and they didn't see their examples as tests.
However for pvlib, doctest may have an additional benefit for testing purposes and also it tests if our documentation is up to date with the state of the objects we document.

@bmu bmu added this to the 0.2 milestone Apr 30, 2015
@wholmgren
Copy link
Member

We definitely need more examples in the docs. I don't know if we need an example for absolutely everything, though. In any case, we probably will want to change the documentation formatting to 1 page per function.

I don't have any experience using doctest, but I'm ok with trying it out. I would say that we should not rely on doctest for anything other than ensuring that the docs are up to date with the library, and that anything that is in a doctest should be in the main tests.

@bmu bmu modified the milestones: Someday, 0.2 Jun 21, 2015
@wholmgren wholmgren added the easy label Nov 13, 2015
@wholmgren wholmgren changed the title Add examples to dostrings Add examples to docstrings May 6, 2016
@mikofski
Copy link
Member

Any decision on this?

@wholmgren
Copy link
Member

@mikofski I support adding brief examples to the function docstrings where they would be useful. Personally, I find documentation pages structured like ModelChain and Clearsky to be more useful, so that's where I've focused my documentation efforts. But I encourage people that want small examples for each function to take on the effort. So I lean toward leaving this generic issue open. What do you think?

@abhinav9414
Copy link

can I try to do this sir.

@cwhanse
Copy link
Member

cwhanse commented Mar 2, 2021

can I try to do this sir.

Certainly. Are you somewhat familiar with PV system modeling? That would help with forming examples.

It would be best to take this up in small pieces. Maybe the file iam.py is a place to begin.

@abhinav9414
Copy link

abhinav9414 commented Mar 2, 2021

ok ill start with the iam.py file, thanks for the boost.

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

5 participants