Skip to content

Comments

docs: Add module and class docstrings to all source files#3396

Merged
springfall2008 merged 1 commit intomainfrom
add-docstrings
Feb 19, 2026
Merged

docs: Add module and class docstrings to all source files#3396
springfall2008 merged 1 commit intomainfrom
add-docstrings

Conversation

@mgazza
Copy link
Collaborator

@mgazza mgazza commented Feb 19, 2026

Summary

  • Adds module-level docstrings to all 36 Python source files describing each module's purpose and key responsibilities
  • Adds class-level docstrings to 19 classes that were missing them (20 classes already had docstrings)
  • Uses Google-style docstring format throughout
  • Pure documentation — no code logic changes

Coverage

All major subsystems documented:

  • Core engine: predbat.py, prediction.py, plan.py, execute.py
  • Data fetching: fetch.py, octopus.py, futurerate.py, energydataservice.py, download.py
  • Inverter integrations: inverter.py, gecloud.py, fox.py, solis.py, solax.py
  • Web interface: web.py, web_helper.py, web_mcp.py, userinterface.py
  • HA integration: ha.py, hass.py, plugin_system.py, component_base.py, components.py
  • Supporting modules: config.py, const.py, utils.py, output.py, db_engine.py, db_manager.py, load_predictor.py, load_ml_component.py, solcast.py, predheat.py, alertfeed.py, carbon.py, temperature.py, axle.py, ohme.py, compare.py

Test plan

  • Verify black formatting passes (already validated by pre-commit hooks)
  • Verify cspell passes (already validated by pre-commit hooks)
  • Confirm no functional changes — only docstring additions

🤖 Generated with Claude Code

Add comprehensive Google-style docstrings to all Python source files in
the predbat codebase. Every source file now has a module-level docstring
describing its purpose, and all major classes have class-level docstrings
documenting their role, key attributes, and relationships.

This enables pydoc/pdoc auto-documentation and improves IDE tooltip
support for developers working with the codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive documentation to the PredBat codebase by adding module-level and class-level docstrings to all 36 Python source files. The documentation uses Google-style format throughout and maintains consistency with British English spelling conventions used in the codebase.

Changes:

  • Added module-level docstrings to all 36 source files describing each module's purpose and key responsibilities
  • Added class-level docstrings to 19 classes that were missing them (20 classes already had docstrings)
  • Updated one existing class docstring in predbat.py to be more comprehensive
  • All docstrings use Google-style format (summary + blank line + detailed description)

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.

Show a summary per file
File Description
web_helper.py Module docstring describing CSS/JavaScript generators for web UI
web.py Module and WebInterface class docstrings for the aiohttp web server
utils.py Module docstring for utility functions (time, data processing, calculations)
userinterface.py Module and UserInterface class docstrings for config management
temperature.py Module and TemperatureAPI class docstrings for Open-Meteo integration
solcast.py Module docstring for solar forecast integration
solax.py Module docstring for SolaX Cloud API integration
prediction.py Module docstring for the minute-by-minute battery simulation engine
predheat.py Module docstring for heat pump prediction
predbat.py Module and updated PredBat class docstrings for the main orchestrator
plugin_system.py Module docstring for plugin discovery and hook management
plan.py Module and Plan class docstrings for charge/discharge optimization
output.py Module and Output class docstrings for sensor publishing
ohme.py Module docstring for Ohme EV charger integration
octopus.py Module docstring and docstrings for 3 classes (OctopusEnergyApiClient, OctopusAPI, Octopus)
load_predictor.py Module docstring for NumPy-only MLP neural network
load_ml_component.py Module docstring for ML load forecasting component wrapper
inverter.py Module and Inverter class docstrings for multi-brand inverter abstraction
hass.py Module and Hass class docstrings for standalone mode wrapper
ha.py Module docstring for Home Assistant communication interface
gecloud.py Module docstring for GivEnergy Cloud API
futurerate.py Module and FutureRate class docstrings for Nord Pool rate prediction
fox.py Module docstring for Fox ESS Cloud API
fetch.py Module and Fetch class docstrings for data fetching orchestration
execute.py Module and Execute class docstrings for plan execution
energydataservice.py Module and Energidataservice class docstrings for Danish electricity rates
download.py Module docstring for PredBat self-update utilities
db_manager.py Module and DatabaseManager class docstrings for async database with IPC queue
db_engine.py Module and DatabaseEngine class docstrings for SQLite persistence
const.py Module docstring for global constants
config.py Module docstring for configuration item definitions
components.py Module and Components class docstrings for component registry
component_base.py Module docstring for abstract base class
compare.py Module and Compare class docstrings for tariff comparison
axle.py Module docstring for Axle Energy VPP integration
alertfeed.py Module and AlertFeed class docstrings for weather alerts

@springfall2008 springfall2008 merged commit 72f581b into main Feb 19, 2026
6 checks passed
@springfall2008 springfall2008 deleted the add-docstrings branch February 19, 2026 20:09
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