ELEKTRONN / elektronn3

A PyTorch-based library for working with 3D and 2D convolutional neural networks, with focus on semantic segmentation of volumetric biomedical image data
MIT License
160 stars 27 forks source link

Docstrings and type information #15

Closed mdraw closed 5 years ago

mdraw commented 6 years ago

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 https://github.com/ELEKTRONN/elektronn3/blob/a18301d19e7dd88a0e32926be850bf35da886138/elektronn3/models/unet.py#L225

mdraw commented 6 years ago

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.