Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
requirements.txt
requirements-dev.txt
pyproject.toml

- name: Install dependencies
- name: Install project and development tools
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install --editable ".[dev]"

- name: Lint Python sources
run: python -m ruff check src tests streamlit_app.py
Expand All @@ -46,3 +45,15 @@ jobs:

- name: Compile Python sources
run: python -m compileall -q src tests streamlit_app.py

- name: Build wheel and source distribution
run: python -m build

- name: Smoke-test installed console commands
run: |
aep-demo --help
aep-sample-data --help
aep-make-features --help
aep-baseline-eval --help
aep-xgb-eval --help
aep-forecast --help
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ data/
.pytest_cache/
__pycache__/
*.py[cod]
build/
dist/
*.egg-info/
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,32 @@ The data is **not** included in this repo. Download `AEP_hourly.csv` (columns `D
Run the complete pipeline against a deterministic 90-day sample:

```powershell
python -m src.demo_pipeline
aep-demo
```

This single command creates the sample data, features, baseline and XGBoost
metrics, evaluation plots, trained model, and next-24h forecast under the
existing ignored `data/`, `reports/`, and `models/` directories. Use
`--output-dir` to keep every artifact below a different directory.
`--output-dir` to keep every artifact below a different directory. The module
form, `python -m src.demo_pipeline`, remains available when working directly
from a source checkout.

The equivalent individual commands are:
The equivalent installed console commands are:

```powershell
python -m src.sample_data
python -m src.make_features `
aep-sample-data
aep-make-features `
--input data\sample_aep_hourly.csv `
--output data\sample_features_aep.csv
python -m src.baseline_eval `
aep-baseline-eval `
--features data\sample_features_aep.csv `
--metrics reports\sample_baseline_metrics.csv `
--plot reports\figures\sample_baseline.png
python -m src.xgb_eval `
aep-xgb-eval `
--features data\sample_features_aep.csv `
--metrics reports\sample_xgb_metrics.csv `
--plot reports\figures\sample_xgb_evaluation.png
python -m src.forecast_24h `
aep-forecast `
--input data\sample_aep_hourly.csv `
--features data\sample_features_aep.csv `
--output reports\sample_forecast.csv `
Expand All @@ -136,11 +138,12 @@ must not be used to reproduce the reported benchmark metrics.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install --editable .
```

The requirements include the Streamlit demo as well as the training and
evaluation dependencies.
This installs the training and evaluation dependencies, the Streamlit demo,
and the six `aep-*` console commands. Use `python -m pip install .` instead
when an editable source checkout is not needed.

## Usage (Windows / PowerShell)

Expand Down Expand Up @@ -215,12 +218,14 @@ python -m src.make_features `
Run the synthetic validation tests with:

```powershell
pip install -r requirements-dev.txt
python -m pip install --editable ".[dev]"
python -m ruff check src tests streamlit_app.py
python -m pytest
python -m build
```

GitHub Actions runs the same lint, test, and source-compilation checks on
GitHub Actions installs the project, runs the same lint, test, source-compilation
and distribution-build checks, and smoke-tests all six console commands on
Python 3.10 and 3.12 for every pull request.

## Limitations
Expand Down
56 changes: 56 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"

[project]
name = "aep-load-forecasting"
version = "0.1.0"
description = "Reproducible AEP electricity-load forecasting with XGBoost"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Amar Akram" },
]
keywords = ["energy", "forecasting", "time-series", "xgboost"]
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"joblib>=1.3",
"matplotlib>=3.7",
"numpy>=1.24",
"pandas>=2.0",
"scikit-learn>=1.3",
"streamlit>=1.30",
"xgboost>=2.0",
]

[project.optional-dependencies]
dev = [
"build>=1.2",
"pytest>=8.0",
"ruff==0.16.0",
]

[project.scripts]
aep-demo = "src.demo_pipeline:main"
aep-sample-data = "src.sample_data:main"
aep-make-features = "src.make_features:main"
aep-baseline-eval = "src.baseline_eval:main"
aep-xgb-eval = "src.xgb_eval:main"
aep-forecast = "src.forecast_24h:main"

[project.urls]
Homepage = "https://github.com/amarakramali/load-forecasting-xgboost"
Issues = "https://github.com/amarakramali/load-forecasting-xgboost/issues"

[tool.setuptools]
packages = ["src"]

[tool.ruff]
target-version = "py310"
line-length = 88
Expand Down
Loading