Skip to content

write all base class API definition docs inside the class #919

@kain88-de

Description

@kain88-de

Update 07-Aug-2016

Base Classes that follow the new guide lines

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

  1. document Base Classes API in __init__
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions