-
Notifications
You must be signed in to change notification settings - Fork 764
Description
Update 07-Aug-2016
- We decided to follow the example in write all base class API definition docs inside the class #919 (comment).
- style guide is updated
Base Classes that follow the new guide lines
- AnalysisBase
- ReaderBase (rename see Base Classes aren't named consistently #921)
- AuxReaderBase (see [WIP] Issue 785 add auxiliary #868)
Original Post
In #892 I noticed that we actually document the default API behavior of base classes like Reader and AnalysisBase. I actually never noticed this because the docs for the classes are in the __init__.py file and not where the class is defined.
This is an issue for me because when I change the API I will very likely forget to update the docs. For the very simple reason that it's not in the same file and I will only look for docs in files that actually define a class. I'm also sure I would overlook this in a PR.
In #892 I went a different way (because I didn't know any better) and used an example piece of code to show the API and an actual analysis can use AnalysisBase. Here the definition of the API lives together with the code. Something I like because it makes it harder for me to forget changing it.
So we have two methods for documentation right now
- document Base Classes API in
__init__ - document Base Classes API in baseclass docstring.
Of course this is a objective issue and different people prefer different styles. I'm OK with both methods (I prefer 2 because I'm forgetful). I just want to know what other people think about this.