Code Style and Documentation#

Code style and documentation are topics that are often overlooked in a software project. However, these are important aspects of a project that can make it easier to maintain and extend.

In this section, we will discuss some of the best practices for code style and documentation.

Lesson Title

Questions

Objectives

Python Coding Style

  • How can I write Python code that is readable?

  • Learn how to raise exceptions.

  • Understand how to follow PEP8 style for Python.

  • Understand what docstrings are and why they are important.

  • Learn to write docstrings in numpy style.

Deciding Package Structure

  • How should I organize my code?

  • How can I handle imports in my package?

  • Break code into modules and subpackages based on functionality.

  • Understand how the __init__.py file affects your Python package.

Type Hinting in Python

  • What is type hinting?

  • What does type hinting do for my software?

  • Learn about type hinting in Python.

  • Learn the syntax to utilize type hinting in Python.

Package Documentation

  • How can we document our package?

  • Explain in-code documentation

  • Explain documentation tools like Read The Docs