Skip to content

Document UnitPlan, its tasks and CalendarContext in the API reference - #506

Merged
derrynknife merged 1 commit into
devfrom
build/task-docs
Nov 21, 2026
Merged

derrynknife merged 1 commit into
devfrom
build/task-docs

Conversation

@derrynknife

Copy link
Copy Markdown
Owner

Summary

test_api_docstrings failed on dev: UnitPlan, Prices, AgePolicy, BlockPolicy, ConditionPolicy, CalendarReplacement, AtShutdown, Inspection, Upgrade, Restoration and ImperfectRepair had no API page, and their parameters (and those of UnitPlan's methods, plus three task spec() methods with no docstring) were not documented.

  • Every parameter now has an entry giving what it means and its unit (the plan's unit of time, or money). Longer rules link to the guide pages ("Maintaining a system", "Repairable systems", "Costs") instead of being written into the parameter.
  • New API page docs/api/unit-plans.md, added to the mkdocs nav and the API index.
  • I checked the classes added since against the same test. schedule.CalendarContext was not on any API page, though a docstring already cross-references it. It is now on the schedule page, and its duty_plan, model_time, rule_times and diagram parameters are documented. schedule.Condition was missing stale, the times of schedule() and a docstring for describe(); all three are added. DutySchedule, Services, DowntimeRiskResult and the value module's names already passed.

No behaviour changes.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / tooling
  • Breaking change

Checklist

  • Tests added/updated: none needed. The existing test_api_docstrings now passes.
  • black, isort, flake8 and mypy pass on the changed files; test_api_docstrings.py + test_help.py (740 passed), test_messages.py (41 passed), and the doctests of the three touched modules (4 passed)
  • Anything that must agree is updated
  • CHANGELOG.md updated under [Unreleased]
  • Any Monte-Carlo tests are seeded (none added)

Notes for reviewers

mkdocs build --strict passes locally, and the new anchors render (repyability.UnitPlan.*, repyability.schedule.CalendarContext). Many of the repyability.schedule names that came earlier (Rate, Roster, UsageForecast, ...) still have undocumented parameters. The test doesn't cover them, because it only walks the top-level __all__, so I left them out of scope.


Generated by Claude Code

The unit plan's classes had no API page and their parameters were not
documented, so test_api_docstrings failed. Each parameter of UnitPlan,
Prices, the preventive tasks, Inspection, Upgrade, Restoration and
ImperfectRepair, and of UnitPlan's methods, is now documented with its
meaning and unit, linking the guide for the longer rules. A new API page,
"Unit plans", lists them; the schedule page gains CalendarContext, whose
methods (and schedule.Condition's) are documented too. No behaviour
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6RpnXB87vwhYETeh7ihtA
@derrynknife
derrynknife merged commit 65f4490 into dev Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants