Skip to content

Add API Documentation with MkDocs #30

@lmz

Description

@lmz

Problem:
The project has some Python docstrings, type hints, and well-documented data models, but no centralized API documentation. Additionally, there is substantial documentation within a variety of Readme markdowns which include documentation about input, output and algorithms. This creates a parallel set of documentation alongside the doe, which creates a barrier to keeping the documentation up-to-date.

Proposed Solution

  • Move the Readme documentation to the python docstrings alongside code, which makes it easier to keep up-to-date and where it sits alongside argument documentation.
  • Generate API documentation using MkDocs Material which will generate documentation from docstrings, with automatic deployment to GitHub Pages.

Documentation Coverage:

  • Codebook: All enumeration types (trip purposes, modes, person types, etc.)
  • Data Models: Pydantic models for survey data and model outputs (DaySim, CTRAMP)
  • Pipeline: Pipeline class, caching mechanism, step decorators
  • Pipeline Steps: All @step() decorated functions with algorithm details

Technical Approach:

  • MkDocs Material theme for clean, searchable interface
  • mkdocstrings[python] for auto-generation from docstrings
  • griffe-pydantic extension for proper Pydantic model documentation
  • GitHub Actions workflow for automatic deployment on merge to main
  • Strict mode to catch broken cross-references

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions