docs: Add module and class docstrings to all source files#3396
Merged
springfall2008 merged 1 commit intomainfrom Feb 19, 2026
Merged
docs: Add module and class docstrings to all source files#3396springfall2008 merged 1 commit intomainfrom
springfall2008 merged 1 commit intomainfrom
Conversation
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>
Contributor
There was a problem hiding this comment.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Coverage
All major subsystems documented:
Test plan
blackformatting passes (already validated by pre-commit hooks)cspellpasses (already validated by pre-commit hooks)🤖 Generated with Claude Code