ELEKTRONN/elektronn3

Docstrings and type information

Closed this issue · 1 comments

mdraw commented

We need docstrings, especially for the two core classes PatchCreator and StoppableTrainer.

While we used NumPy-style docstrings in ELEKTRONN2, I decided to write new docstrings in [Google style] because they are less cumbersome to write, require significantly less lines and are more commonly used (most importantly: PyTorch uses Google style).
IMO they are also more suitable for type-hint-free docstrings. Type hints should not be included in docstrings anymore; they instead belong in the function signatures in a PEP-484-compliant way, so we can eventually use mypy for static type checking.
One example of a class that follows the docstring- and type information style that I am proposing here is the UNet class at

class UNet(nn.Module):

mdraw commented

Update: I've added basic documentation to PatchCreator and StoppableTrainer. We will still need to convert existing docstrings of other code to the new format.