Skip to content

Review and update documentation after numpy-backed API changes #59

Description

@wilsonfreitas

Summary

The documentation currently has two separate problems:

  1. The Sphinx build is blocked by stale path assumptions in docs/source/conf.py and by invoking make -C docs html outside the uv environment.
  2. The published documentation content has drifted from the current numpy-backed public API after the project-structure move, the packaged-calendar migration from .cal to .json, and the newer Calendar.load signature.

Findings

  • make -C docs html fails in the current shell because docs/Makefile calls sphinx-build directly instead of going through uv.
  • uv run make -C docs html fails immediately in docs/source/conf.py because it still copies notebooks from repo-root paths like ../../pandas.ipynb, but those notebooks were moved out of the root in 9f9679a (Organized project structure).
  • After temporarily supplying the expected notebook paths, Sphinx completes but emits warnings/errors that show API drift:
    • docs/source/api.rst still documents getdate and getbizdays, but the public bizdays.Calendar no longer has those members.
    • bizdays/calendar.py docstrings currently emit docutils errors for numpy.int_ / numpy.bool_.
    • docs/source/_static is referenced but missing.
  • The docs content is materially stale:
    • notebooks and docs still use Calendar.load("ANBIMA") and Calendar.load("PMC/NYSE") positionally, but the current public API is keyword-only (name= / filename=).
    • notebooks still use Calendar.load(filename='ANBIMA.cal'), but packaged calendars were migrated to JSON in 3aa16d3; that example now fails.
    • set_option('mode', 'pandas') still exists, but it no longer changes the return type of the top-level numpy-backed Calendar methods.
    • index.md, quick.ipynb, getdate.ipynb, pandas.ipynb, and SITE.ipynb still teach getdate / getbizdays, which are legacy-only now.

Review tracks

1. Build pipeline and source layout

  • Decide the canonical way to build docs (uv run make -C docs html or a Makefile wrapper that is environment-aware).
  • Remove the stale copy-from-root behavior in docs/source/conf.py.
  • Choose one notebook source of truth: notebooks/ or docs/source/, then eliminate the duplicated copy flow.
  • Audit static asset paths such as _static.

2. Public API documentation alignment

  • Re-document the current top-level bizdays.Calendar as the numpy-backed implementation.
  • Remove or clearly separate legacy-only members (getdate, getbizdays, pandas-mode behavior).
  • Update signatures and examples for Calendar.load(name=...), Calendar.load(filename=...), and PMC/....
  • Fix docstrings/types that currently generate Sphinx parsing errors.

3. Example and notebook migration

  • Audit every notebook and Markdown example for:
    • keyword-only Calendar.load
    • .cal vs JSON/custom-file loading
    • current return types (numpy.datetime64 / arrays) instead of legacy datetime.date expectations
    • removed legacy methods
  • Decide whether notebooks should be executable documentation or archival examples.
  • If executable, define which examples must run in CI and which may stay illustrative.

4. Legacy story and migration guidance

  • Decide what remains supported as legacy compatibility (get_option / set_option) versus what should be called out as historical behavior.
  • Add an explicit migration guide from legacy docs/examples to the numpy-backed API.
  • Link that migration guidance from README, docs index, and API reference.

5. Validation strategy

  • Add a reliable docs build command to CI after the content update is complete.
  • Consider a lightweight example-validation pass for the examples that are intended to stay current.

Suggested execution order

  1. Stabilize the docs build path and notebook source layout.
  2. Define the public-vs-legacy documentation boundary.
  3. Update API reference and top-level README/index pages.
  4. Migrate notebooks/examples in batches.
  5. Add docs validation in CI once the content is aligned.

Notes

  • The current docs build does not protect against stale notebook code because nbsphinx is rendering existing notebook content rather than failing on outdated examples.
  • The docs review should cover both docs/source/** and the parallel notebook/Markdown surfaces (notebooks/**, index.md, README.md).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions