forecastforge 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. forecastforge-0.4.0/.dockerignore +29 -0
  2. forecastforge-0.4.0/.editorconfig +38 -0
  3. forecastforge-0.4.0/.env.example +59 -0
  4. forecastforge-0.4.0/.gitattributes +29 -0
  5. forecastforge-0.4.0/.github/ISSUE_TEMPLATE/bug_report.yml +86 -0
  6. forecastforge-0.4.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  7. forecastforge-0.4.0/.github/ISSUE_TEMPLATE/feature_request.yml +71 -0
  8. forecastforge-0.4.0/.github/dependabot.yml +41 -0
  9. forecastforge-0.4.0/.github/pull_request_template.md +42 -0
  10. forecastforge-0.4.0/.github/workflows/ci.yml +207 -0
  11. forecastforge-0.4.0/.github/workflows/docs.yml +81 -0
  12. forecastforge-0.4.0/.github/workflows/pypi.yml +82 -0
  13. forecastforge-0.4.0/.github/workflows/release.yml +121 -0
  14. forecastforge-0.4.0/.github/workflows/security.yml +77 -0
  15. forecastforge-0.4.0/.gitignore +99 -0
  16. forecastforge-0.4.0/.pre-commit-config.yaml +55 -0
  17. forecastforge-0.4.0/CHANGELOG.md +313 -0
  18. forecastforge-0.4.0/CITATION.cff +23 -0
  19. forecastforge-0.4.0/CODE_OF_CONDUCT.md +138 -0
  20. forecastforge-0.4.0/CONTRIBUTING.md +166 -0
  21. forecastforge-0.4.0/LICENSE +21 -0
  22. forecastforge-0.4.0/Makefile +76 -0
  23. forecastforge-0.4.0/PKG-INFO +609 -0
  24. forecastforge-0.4.0/README.md +554 -0
  25. forecastforge-0.4.0/SECURITY.md +64 -0
  26. forecastforge-0.4.0/VERSION +1 -0
  27. forecastforge-0.4.0/configs/development.toml +13 -0
  28. forecastforge-0.4.0/configs/logging.yaml +32 -0
  29. forecastforge-0.4.0/configs/production.toml +13 -0
  30. forecastforge-0.4.0/configs/settings.toml +38 -0
  31. forecastforge-0.4.0/configs/testing.toml +19 -0
  32. forecastforge-0.4.0/docker/Dockerfile +43 -0
  33. forecastforge-0.4.0/docker-compose.yml +31 -0
  34. forecastforge-0.4.0/docs/README.md +41 -0
  35. forecastforge-0.4.0/docs/adr/0001-use-src-layout.md +92 -0
  36. forecastforge-0.4.0/docs/api/cli.md +11 -0
  37. forecastforge-0.4.0/docs/api/config.md +33 -0
  38. forecastforge-0.4.0/docs/api/core.md +9 -0
  39. forecastforge-0.4.0/docs/api/data.md +22 -0
  40. forecastforge-0.4.0/docs/api/evaluation.md +17 -0
  41. forecastforge-0.4.0/docs/api/features.md +24 -0
  42. forecastforge-0.4.0/docs/api/models.md +22 -0
  43. forecastforge-0.4.0/docs/api/overview.md +29 -0
  44. forecastforge-0.4.0/docs/api/pipelines.md +8 -0
  45. forecastforge-0.4.0/docs/api/schemas.md +13 -0
  46. forecastforge-0.4.0/docs/architecture.md +81 -0
  47. forecastforge-0.4.0/docs/assets/backtest_overview.png +0 -0
  48. forecastforge-0.4.0/docs/assets/benchmark_mase.png +0 -0
  49. forecastforge-0.4.0/docs/assets/benchmark_results.md +31 -0
  50. forecastforge-0.4.0/docs/assets/feature_overview.png +0 -0
  51. forecastforge-0.4.0/docs/assets/synthetic_spy_demo.png +0 -0
  52. forecastforge-0.4.0/docs/cli.md +146 -0
  53. forecastforge-0.4.0/docs/data-pipeline.md +117 -0
  54. forecastforge-0.4.0/docs/development.md +182 -0
  55. forecastforge-0.4.0/docs/feature-engineering.md +164 -0
  56. forecastforge-0.4.0/docs/index.md +142 -0
  57. forecastforge-0.4.0/docs/model-comparison.md +242 -0
  58. forecastforge-0.4.0/docs/monitoring.md +34 -0
  59. forecastforge-0.4.0/docs/publishing.md +83 -0
  60. forecastforge-0.4.0/docs/serving.md +31 -0
  61. forecastforge-0.4.0/examples/01_synthetic_data.py +149 -0
  62. forecastforge-0.4.0/examples/02_features.py +203 -0
  63. forecastforge-0.4.0/examples/03_backtesting.py +175 -0
  64. forecastforge-0.4.0/mkdocs.yml +111 -0
  65. forecastforge-0.4.0/notebooks/.gitkeep +0 -0
  66. forecastforge-0.4.0/pipelines/.gitkeep +0 -0
  67. forecastforge-0.4.0/pyproject.toml +211 -0
  68. forecastforge-0.4.0/scripts/bootstrap.ps1 +60 -0
  69. forecastforge-0.4.0/scripts/bootstrap.sh +63 -0
  70. forecastforge-0.4.0/src/forecastforge/__init__.py +41 -0
  71. forecastforge-0.4.0/src/forecastforge/cli/__init__.py +12 -0
  72. forecastforge-0.4.0/src/forecastforge/cli/__main__.py +13 -0
  73. forecastforge-0.4.0/src/forecastforge/cli/main.py +477 -0
  74. forecastforge-0.4.0/src/forecastforge/common/__init__.py +6 -0
  75. forecastforge-0.4.0/src/forecastforge/config/__init__.py +61 -0
  76. forecastforge-0.4.0/src/forecastforge/config/_optional.py +39 -0
  77. forecastforge-0.4.0/src/forecastforge/config/device.py +98 -0
  78. forecastforge-0.4.0/src/forecastforge/config/environment.py +50 -0
  79. forecastforge-0.4.0/src/forecastforge/config/paths.py +131 -0
  80. forecastforge-0.4.0/src/forecastforge/config/runtime.py +76 -0
  81. forecastforge-0.4.0/src/forecastforge/config/seed.py +56 -0
  82. forecastforge-0.4.0/src/forecastforge/config/settings.py +249 -0
  83. forecastforge-0.4.0/src/forecastforge/core/__init__.py +21 -0
  84. forecastforge-0.4.0/src/forecastforge/core/errors.py +42 -0
  85. forecastforge-0.4.0/src/forecastforge/data/__init__.py +31 -0
  86. forecastforge-0.4.0/src/forecastforge/data/loaders.py +62 -0
  87. forecastforge-0.4.0/src/forecastforge/data/source.py +140 -0
  88. forecastforge-0.4.0/src/forecastforge/data/synthetic.py +212 -0
  89. forecastforge-0.4.0/src/forecastforge/data/yfinance_source.py +105 -0
  90. forecastforge-0.4.0/src/forecastforge/evaluation/__init__.py +44 -0
  91. forecastforge-0.4.0/src/forecastforge/evaluation/backtest.py +372 -0
  92. forecastforge-0.4.0/src/forecastforge/evaluation/benchmark.py +557 -0
  93. forecastforge-0.4.0/src/forecastforge/evaluation/metrics.py +318 -0
  94. forecastforge-0.4.0/src/forecastforge/features/__init__.py +67 -0
  95. forecastforge-0.4.0/src/forecastforge/features/builtins.py +540 -0
  96. forecastforge-0.4.0/src/forecastforge/features/frame.py +241 -0
  97. forecastforge-0.4.0/src/forecastforge/features/pipeline.py +84 -0
  98. forecastforge-0.4.0/src/forecastforge/features/transform.py +104 -0
  99. forecastforge-0.4.0/src/forecastforge/models/__init__.py +36 -0
  100. forecastforge-0.4.0/src/forecastforge/models/base.py +178 -0
  101. forecastforge-0.4.0/src/forecastforge/models/baselines.py +172 -0
  102. forecastforge-0.4.0/src/forecastforge/models/gbm.py +282 -0
  103. forecastforge-0.4.0/src/forecastforge/models/statistical.py +213 -0
  104. forecastforge-0.4.0/src/forecastforge/monitoring/__init__.py +6 -0
  105. forecastforge-0.4.0/src/forecastforge/pipelines/__init__.py +25 -0
  106. forecastforge-0.4.0/src/forecastforge/pipelines/synthetic_backtest.py +168 -0
  107. forecastforge-0.4.0/src/forecastforge/py.typed +0 -0
  108. forecastforge-0.4.0/src/forecastforge/schemas/__init__.py +19 -0
  109. forecastforge-0.4.0/src/forecastforge/schemas/time_series.py +101 -0
  110. forecastforge-0.4.0/src/forecastforge/schemas/validation.py +222 -0
  111. forecastforge-0.4.0/src/forecastforge/serving/__init__.py +5 -0
  112. forecastforge-0.4.0/src/forecastforge/tracking/__init__.py +6 -0
  113. forecastforge-0.4.0/src/forecastforge/utils/__init__.py +6 -0
  114. forecastforge-0.4.0/tests/__init__.py +6 -0
  115. forecastforge-0.4.0/tests/cli/__init__.py +1 -0
  116. forecastforge-0.4.0/tests/cli/test_main.py +424 -0
  117. forecastforge-0.4.0/tests/config/__init__.py +1 -0
  118. forecastforge-0.4.0/tests/config/test_device.py +117 -0
  119. forecastforge-0.4.0/tests/config/test_environment.py +33 -0
  120. forecastforge-0.4.0/tests/config/test_optional.py +30 -0
  121. forecastforge-0.4.0/tests/config/test_paths.py +77 -0
  122. forecastforge-0.4.0/tests/config/test_runtime.py +48 -0
  123. forecastforge-0.4.0/tests/config/test_seed.py +111 -0
  124. forecastforge-0.4.0/tests/config/test_settings.py +143 -0
  125. forecastforge-0.4.0/tests/conftest.py +15 -0
  126. forecastforge-0.4.0/tests/core/__init__.py +0 -0
  127. forecastforge-0.4.0/tests/core/test_errors.py +39 -0
  128. forecastforge-0.4.0/tests/data/__init__.py +0 -0
  129. forecastforge-0.4.0/tests/data/test_loaders.py +66 -0
  130. forecastforge-0.4.0/tests/data/test_synthetic.py +171 -0
  131. forecastforge-0.4.0/tests/data/test_yfinance_source.py +78 -0
  132. forecastforge-0.4.0/tests/evaluation/__init__.py +1 -0
  133. forecastforge-0.4.0/tests/evaluation/test_backtest.py +586 -0
  134. forecastforge-0.4.0/tests/evaluation/test_benchmark.py +297 -0
  135. forecastforge-0.4.0/tests/evaluation/test_metrics.py +234 -0
  136. forecastforge-0.4.0/tests/features/__init__.py +0 -0
  137. forecastforge-0.4.0/tests/features/conftest.py +32 -0
  138. forecastforge-0.4.0/tests/features/helpers.py +17 -0
  139. forecastforge-0.4.0/tests/features/test_builtins.py +345 -0
  140. forecastforge-0.4.0/tests/features/test_frame.py +191 -0
  141. forecastforge-0.4.0/tests/features/test_leakage.py +245 -0
  142. forecastforge-0.4.0/tests/features/test_pipeline.py +90 -0
  143. forecastforge-0.4.0/tests/features/test_transform.py +92 -0
  144. forecastforge-0.4.0/tests/models/__init__.py +1 -0
  145. forecastforge-0.4.0/tests/models/test_base.py +134 -0
  146. forecastforge-0.4.0/tests/models/test_baselines.py +134 -0
  147. forecastforge-0.4.0/tests/models/test_gbm.py +213 -0
  148. forecastforge-0.4.0/tests/models/test_statistical.py +139 -0
  149. forecastforge-0.4.0/tests/pipelines/__init__.py +1 -0
  150. forecastforge-0.4.0/tests/pipelines/test_synthetic_backtest.py +113 -0
  151. forecastforge-0.4.0/tests/schemas/__init__.py +0 -0
  152. forecastforge-0.4.0/tests/schemas/test_time_series.py +134 -0
  153. forecastforge-0.4.0/tests/schemas/test_validation.py +271 -0
  154. forecastforge-0.4.0/tests/test_package_metadata.py +22 -0
@@ -0,0 +1,29 @@
1
+ # Build context for docker/Dockerfile: the image needs only the packaging
2
+ # metadata, the license, and the source tree. Everything else in the
3
+ # checkout is excluded so the context stays small and cannot leak local
4
+ # data, caches, or environment files into the image.
5
+ .git
6
+ .venv
7
+ .github
8
+ .idea
9
+ .vscode
10
+ **/__pycache__
11
+ **/*.py[cod]
12
+ *.egg-info
13
+ build/
14
+ dist/
15
+ site/
16
+ data/
17
+ docs/
18
+ examples/
19
+ notebooks/
20
+ tests/
21
+ mlruns/
22
+ models/
23
+ .coverage
24
+ coverage.xml
25
+ .mypy_cache
26
+ .pytest_cache
27
+ .ruff_cache
28
+ docker-compose.yml
29
+ .env*
@@ -0,0 +1,38 @@
1
+ # EditorConfig helps maintain consistent coding styles across editors/IDEs.
2
+ # https://editorconfig.org
3
+
4
+ root = true
5
+
6
+ [*]
7
+ charset = utf-8
8
+ end_of_line = lf
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
11
+ indent_style = space
12
+ indent_size = 4
13
+
14
+ [*.py]
15
+ indent_size = 4
16
+ max_line_length = 100
17
+
18
+ [*.{yml,yaml}]
19
+ indent_size = 2
20
+
21
+ [*.toml]
22
+ indent_size = 4
23
+
24
+ [*.json]
25
+ indent_size = 2
26
+
27
+ [*.md]
28
+ trim_trailing_whitespace = false
29
+ max_line_length = off
30
+
31
+ [Makefile]
32
+ indent_style = tab
33
+
34
+ [*.{sh,bash}]
35
+ indent_size = 2
36
+
37
+ [*.{Dockerfile,dockerfile}]
38
+ indent_size = 4
@@ -0,0 +1,59 @@
1
+ # .env.example — Template for local environment configuration.
2
+ #
3
+ # Copy this file to `.env` and adjust values for your local setup:
4
+ # cp .env.example .env
5
+ #
6
+ # `.env` is git-ignored and must never be committed. Every variable
7
+ # below corresponds directly to a field on
8
+ # `forecastforge.config.settings.Settings` and follows the
9
+ # FORECASTFORGE_<FIELD_NAME> naming convention. Any variable you leave
10
+ # commented out simply falls through to the TOML configuration
11
+ # (`configs/settings.toml` + `configs/<environment>.toml`) and then to
12
+ # the field default. See docs/development.md for the full
13
+ # configuration precedence order.
14
+
15
+ # ---------------------------------------------------------------------------
16
+ # Application
17
+ # ---------------------------------------------------------------------------
18
+ FORECASTFORGE_ENV=development
19
+ # FORECASTFORGE_APP_NAME=forecastforge
20
+ # FORECASTFORGE_LOG_LEVEL=INFO
21
+ # FORECASTFORGE_RANDOM_SEED=42
22
+
23
+ # ---------------------------------------------------------------------------
24
+ # Paths (override to relocate local data/model/artifact workspaces)
25
+ # ---------------------------------------------------------------------------
26
+ # FORECASTFORGE_DATA_DIR=data
27
+ # FORECASTFORGE_MODELS_DIR=models
28
+ # FORECASTFORGE_ARTIFACTS_DIR=artifacts
29
+ # FORECASTFORGE_MLRUNS_DIR=mlruns
30
+
31
+ # ---------------------------------------------------------------------------
32
+ # Forecasting defaults
33
+ # ---------------------------------------------------------------------------
34
+ # FORECASTFORGE_DEFAULT_ASSET_SYMBOL=SPY
35
+ # FORECASTFORGE_DEFAULT_TIMEFRAME=1d
36
+ # FORECASTFORGE_SEQUENCE_LENGTH=64
37
+ # FORECASTFORGE_BATCH_SIZE=32
38
+ # FORECASTFORGE_NUM_WORKERS=4
39
+
40
+ # ---------------------------------------------------------------------------
41
+ # Compute device — one of: auto, cpu, cuda, mps
42
+ # ---------------------------------------------------------------------------
43
+ # FORECASTFORGE_DEVICE_PREFERENCE=auto
44
+
45
+ # ---------------------------------------------------------------------------
46
+ # Advanced overrides (rarely needed)
47
+ # ---------------------------------------------------------------------------
48
+ # Overrides project-root auto-detection (see
49
+ # forecastforge.config.paths.get_project_root). Useful in containers or
50
+ # non-editable installs where there is no source tree to search.
51
+ # FORECASTFORGE_PROJECT_ROOT=/absolute/path/to/forecastforge
52
+
53
+ # ---------------------------------------------------------------------------
54
+ # Reserved for future use (uncomment and populate when implemented)
55
+ # ---------------------------------------------------------------------------
56
+ # FORECASTFORGE_DATABASE_URL=
57
+ # FORECASTFORGE_MLFLOW_TRACKING_URI=
58
+ # FORECASTFORGE_API_HOST=0.0.0.0
59
+ # FORECASTFORGE_API_PORT=8000
@@ -0,0 +1,29 @@
1
+ # Line-ending policy.
2
+ #
3
+ # Git normalizes text files to LF in the object database and checks them out
4
+ # with LF in the working tree, overriding any user-level core.autocrlf
5
+ # setting. This keeps the repository byte-identical on Windows, macOS, and
6
+ # Linux, and it is required by tooling that is configured for LF: Ruff's
7
+ # formatter runs with line-ending = "lf", so a CRLF working tree fails
8
+ # `ruff format --check` even when the committed blobs are already correct.
9
+ * text=auto eol=lf
10
+
11
+ # Binary assets must never be normalized: doing so corrupts them.
12
+ *.png binary
13
+ *.jpg binary
14
+ *.jpeg binary
15
+ *.gif binary
16
+ *.ico binary
17
+ *.pdf binary
18
+ *.zip binary
19
+ *.gz binary
20
+ *.tar binary
21
+ *.npy binary
22
+ *.npz binary
23
+ *.parquet binary
24
+ *.pkl binary
25
+ *.joblib binary
26
+ *.pt binary
27
+ *.pth binary
28
+ *.onnx binary
29
+ *.mlmodel binary
@@ -0,0 +1,86 @@
1
+ name: Bug report
2
+ description: Report something that is broken or behaves unexpectedly.
3
+ title: "fix: <short description of the bug>"
4
+ labels: ["bug", "needs-triage"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for taking the time to file a bug report.
10
+
11
+ Please do **not** report security vulnerabilities here — see
12
+ [SECURITY.md](https://github.com/Abolfazlrwm/forecastforge/blob/main/SECURITY.md)
13
+ for the private reporting process.
14
+
15
+ - type: checkboxes
16
+ id: preflight
17
+ attributes:
18
+ label: Preflight checks
19
+ options:
20
+ - label: I have searched existing issues and this is not a duplicate.
21
+ required: true
22
+ - label: I am running a supported Python version (3.12 or newer).
23
+ required: true
24
+
25
+ - type: textarea
26
+ id: what-happened
27
+ attributes:
28
+ label: What happened?
29
+ description: A clear description of the actual behaviour.
30
+ validations:
31
+ required: true
32
+
33
+ - type: textarea
34
+ id: expected
35
+ attributes:
36
+ label: What did you expect to happen?
37
+ validations:
38
+ required: true
39
+
40
+ - type: textarea
41
+ id: reproduction
42
+ attributes:
43
+ label: Steps to reproduce
44
+ description: >
45
+ A minimal, self-contained reproduction. Prefer a short code snippet or
46
+ a sequence of commands over a prose description.
47
+ placeholder: |
48
+ 1. ...
49
+ 2. ...
50
+ 3. ...
51
+ render: shell
52
+ validations:
53
+ required: true
54
+
55
+ - type: textarea
56
+ id: traceback
57
+ attributes:
58
+ label: Relevant log output or traceback
59
+ description: Paste the full traceback if there is one.
60
+ render: shell
61
+ validations:
62
+ required: false
63
+
64
+ - type: input
65
+ id: version
66
+ attributes:
67
+ label: ForecastForge version
68
+ description: Output of `python -c "import forecastforge; print(forecastforge.__version__)"`, or the commit SHA.
69
+ validations:
70
+ required: true
71
+
72
+ - type: input
73
+ id: python-version
74
+ attributes:
75
+ label: Python version and operating system
76
+ placeholder: "3.12.4 on Ubuntu 24.04"
77
+ validations:
78
+ required: true
79
+
80
+ - type: textarea
81
+ id: context
82
+ attributes:
83
+ label: Anything else?
84
+ description: Additional context that might help diagnose the problem.
85
+ validations:
86
+ required: false
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security vulnerability
4
+ url: https://github.com/Abolfazlrwm/forecastforge/security/advisories/new
5
+ about: Report security issues privately — never in a public issue.
6
+ - name: Question or usage help
7
+ url: https://github.com/Abolfazlrwm/forecastforge/discussions
8
+ about: Ask questions and discuss ideas with other users and maintainers.
@@ -0,0 +1,71 @@
1
+ name: Feature request
2
+ description: Propose a new capability or an improvement to an existing one.
3
+ title: "feat: <short description of the proposal>"
4
+ labels: ["enhancement", "needs-triage"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for the proposal. Please describe the problem before the
10
+ solution — it makes the trade-offs much easier to evaluate.
11
+
12
+ - type: checkboxes
13
+ id: preflight
14
+ attributes:
15
+ label: Preflight checks
16
+ options:
17
+ - label: I have searched existing issues and this is not a duplicate.
18
+ required: true
19
+ - label: I have read the roadmap in the README.
20
+ required: true
21
+
22
+ - type: textarea
23
+ id: problem
24
+ attributes:
25
+ label: What problem does this solve?
26
+ description: Describe the situation you are in and why the current behaviour is not enough.
27
+ validations:
28
+ required: true
29
+
30
+ - type: textarea
31
+ id: proposal
32
+ attributes:
33
+ label: Proposed solution
34
+ description: What would you like ForecastForge to do?
35
+ validations:
36
+ required: true
37
+
38
+ - type: textarea
39
+ id: alternatives
40
+ attributes:
41
+ label: Alternatives considered
42
+ description: Other approaches, including what you currently do instead.
43
+ validations:
44
+ required: false
45
+
46
+ - type: dropdown
47
+ id: area
48
+ attributes:
49
+ label: Which part of the project does this touch?
50
+ options:
51
+ - Data ingestion and schemas
52
+ - Feature engineering
53
+ - Models and evaluation
54
+ - Backtesting
55
+ - Experiment tracking
56
+ - Serving API
57
+ - Monitoring
58
+ - CLI and pipelines
59
+ - Packaging, CI, or tooling
60
+ - Documentation
61
+ - Not sure
62
+ validations:
63
+ required: true
64
+
65
+ - type: checkboxes
66
+ id: contribution
67
+ attributes:
68
+ label: Contribution
69
+ options:
70
+ - label: I would be willing to open a pull request for this.
71
+ required: false
@@ -0,0 +1,41 @@
1
+ version: 2
2
+
3
+ # Automated dependency updates.
4
+ #
5
+ # Minor and patch bumps are grouped into a single PR per ecosystem to keep
6
+ # review load low; major bumps are left as individual PRs because they
7
+ # usually need a migration decision rather than a rubber stamp.
8
+
9
+ updates:
10
+ - package-ecosystem: "pip"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "weekly"
14
+ open-pull-requests-limit: 5
15
+ commit-message:
16
+ prefix: "build"
17
+ include: "scope"
18
+ groups:
19
+ python-minor-and-patch:
20
+ patterns: ["*"]
21
+ update-types: ["minor", "patch"]
22
+
23
+ - package-ecosystem: "github-actions"
24
+ directory: "/"
25
+ schedule:
26
+ interval: "weekly"
27
+ open-pull-requests-limit: 5
28
+ commit-message:
29
+ prefix: "ci"
30
+ include: "scope"
31
+ groups:
32
+ github-actions:
33
+ patterns: ["*"]
34
+
35
+ - package-ecosystem: "pre-commit"
36
+ directory: "/"
37
+ schedule:
38
+ interval: "monthly"
39
+ commit-message:
40
+ prefix: "build"
41
+ include: "scope"
@@ -0,0 +1,42 @@
1
+ <!--
2
+ Thanks for contributing to ForecastForge. Keep the description focused on
3
+ what changed and why; the checklist below is what reviewers will verify.
4
+ -->
5
+
6
+ ## What does this change?
7
+
8
+ <!-- A short summary of the change. Link the issue it closes, if any. -->
9
+
10
+ Closes #
11
+
12
+ ## Why?
13
+
14
+ <!--
15
+ The motivation: the bug, the limitation, or the use case. Reviewers should
16
+ be able to judge the approach without reading the diff first.
17
+ -->
18
+
19
+ ## How was it verified?
20
+
21
+ <!--
22
+ Commands you ran and what they reported. For behaviour changes, describe the
23
+ test that now covers it. If a number appears in the docs or README, say
24
+ which command produces it.
25
+ -->
26
+
27
+ ## Checklist
28
+
29
+ - [ ] `ruff check .` passes
30
+ - [ ] `ruff format --check .` passes
31
+ - [ ] `mypy src` passes
32
+ - [ ] `pytest` passes
33
+ - [ ] New or changed behaviour has tests
34
+ - [ ] Public modules, classes, and functions have docstrings and type hints
35
+ - [ ] Documentation (`README.md`, `docs/`, ADRs) is updated if behaviour or
36
+ architecture changed
37
+ - [ ] Commits follow [Conventional Commits](https://www.conventionalcommits.org/)
38
+ - [ ] The branch targets `develop`, not `main`
39
+
40
+ ## Notes for reviewers
41
+
42
+ <!-- Anything you are unsure about, or would like a second opinion on. -->
@@ -0,0 +1,207 @@
1
+ name: CI
2
+
3
+ # Continuous integration for ForecastForge.
4
+ #
5
+ # The quality job runs the same gates on every supported Python: 3.12 is the
6
+ # floor declared in pyproject.toml, and 3.13 is what contributors run locally,
7
+ # so a regression that only shows up on one of them must not slip through.
8
+ # The wheel build/import check runs once (3.12) because the wheel layout does
9
+ # not depend on the interpreter version; lint, types, and tests run on both.
10
+
11
+ on:
12
+ push:
13
+ branches: [main, develop]
14
+ pull_request:
15
+ branches: [main, develop]
16
+ workflow_dispatch: {}
17
+
18
+ concurrency:
19
+ group: ci-${{ github.workflow }}-${{ github.ref }}
20
+ cancel-in-progress: true
21
+
22
+ permissions:
23
+ contents: read
24
+
25
+ env:
26
+ PIP_DISABLE_PIP_VERSION_CHECK: "1"
27
+
28
+ jobs:
29
+ quality:
30
+ name: Lint, type-check, test, and package (Python ${{ matrix.python-version }})
31
+ runs-on: ubuntu-latest
32
+ timeout-minutes: 15
33
+ strategy:
34
+ fail-fast: false
35
+ matrix:
36
+ python-version: ["3.12", "3.13"]
37
+
38
+ steps:
39
+ - name: Checkout repository
40
+ uses: actions/checkout@v7
41
+
42
+ - name: Set up Python ${{ matrix.python-version }}
43
+ uses: actions/setup-python@v7
44
+ with:
45
+ python-version: ${{ matrix.python-version }}
46
+ cache: "pip"
47
+
48
+ - name: Install package with dev dependencies
49
+ run: |
50
+ python -m pip install --upgrade pip
51
+ pip install -e ".[dev]"
52
+
53
+ - name: Lint with Ruff
54
+ run: ruff check .
55
+
56
+ - name: Check formatting with Ruff
57
+ run: ruff format --check .
58
+
59
+ - name: Type-check with MyPy
60
+ run: mypy src
61
+
62
+ - name: Test with pytest
63
+ run: pytest
64
+
65
+ - name: Upload coverage report
66
+ if: always()
67
+ uses: actions/upload-artifact@v7
68
+ with:
69
+ name: coverage-xml-${{ matrix.python-version }}
70
+ path: coverage.xml
71
+ if-no-files-found: ignore
72
+ retention-days: 7
73
+
74
+ # The gates above run against an editable install, which maps src/ onto
75
+ # sys.path and therefore cannot detect a broken wheel layout. This step
76
+ # builds the real distribution and imports it from a clean environment.
77
+ # It runs once, on 3.12: the wheel layout is interpreter-independent.
78
+ - name: Build wheel
79
+ if: matrix.python-version == '3.12'
80
+ run: python -m build --wheel --outdir dist
81
+
82
+ - name: Install the wheel into a clean venv and import it
83
+ if: matrix.python-version == '3.12'
84
+ run: |
85
+ python -m venv /tmp/wheel-check
86
+ /tmp/wheel-check/bin/python -m pip install --upgrade pip
87
+ /tmp/wheel-check/bin/python -m pip install dist/*.whl
88
+ # Run from a neutral directory so the checked-out source tree
89
+ # cannot shadow the installed package.
90
+ cd /tmp
91
+ /tmp/wheel-check/bin/python - <<'PY'
92
+ import forecastforge
93
+ from forecastforge.config import DeviceType, get_settings, set_seed
94
+
95
+ assert forecastforge.__version__, "package version is not exposed"
96
+ settings = get_settings()
97
+ set_seed(settings.random_seed)
98
+ assert settings.resolved_device() in {
99
+ DeviceType.CPU,
100
+ DeviceType.CUDA,
101
+ DeviceType.MPS,
102
+ }
103
+ print(f"wheel import OK: {forecastforge.__file__}")
104
+ PY
105
+ # The console script must survive a non-editable install too: an
106
+ # entry point that points at a module outside the wheel would only
107
+ # fail on user machines.
108
+ /tmp/wheel-check/bin/forecastforge --version
109
+ /tmp/wheel-check/bin/forecastforge info | head -1
110
+
111
+ # The optional forecasters are behind the `models` extra, and their tests
112
+ # skip when the extra is absent — which is correct for a core install but
113
+ # would let a broken statsmodels or lightgbm integration stay green
114
+ # forever. This job installs the extra and runs those tests for real. The
115
+ # import check runs first so a failed install fails loudly instead of
116
+ # silently turning into a skip.
117
+ optional-models:
118
+ name: Optional models (Python ${{ matrix.python-version }})
119
+ runs-on: ubuntu-latest
120
+ timeout-minutes: 20
121
+ strategy:
122
+ fail-fast: false
123
+ matrix:
124
+ python-version: ["3.12", "3.13"]
125
+
126
+ steps:
127
+ - name: Checkout repository
128
+ uses: actions/checkout@v7
129
+
130
+ - name: Set up Python ${{ matrix.python-version }}
131
+ uses: actions/setup-python@v7
132
+ with:
133
+ python-version: ${{ matrix.python-version }}
134
+ cache: "pip"
135
+
136
+ - name: Install package with dev and models extras
137
+ run: |
138
+ python -m pip install --upgrade pip
139
+ pip install -e ".[dev,models]"
140
+
141
+ - name: Verify the optional dependencies are importable
142
+ run: |
143
+ python -c "import statsmodels, lightgbm; print('statsmodels', statsmodels.__version__); print('lightgbm', lightgbm.__version__)"
144
+
145
+ - name: Test the optional models
146
+ # -rs lists the skip reasons, so a dependency that vanishes from the
147
+ # runner shows up in the log rather than passing quietly.
148
+ run: pytest tests/models -q --no-cov -rs
149
+
150
+ # The benchmark is a reporting target, not a test gate, so a broken import or
151
+ # a bad default would otherwise slip through until someone ran it by hand.
152
+ # This job runs it in fast mode (one seed, short series, no figure) on every
153
+ # push so a regression in `make benchmark` is caught in CI, not in a
154
+ # contributor's terminal. It installs the dev extra only: the baselines need
155
+ # no optional dependency, and --no-plot skips matplotlib. `make` auto-detects
156
+ # the interpreter, falling back to `python` here since there is no venv.
157
+ benchmark-smoke:
158
+ name: Benchmark smoke (Python ${{ matrix.python-version }})
159
+ runs-on: ubuntu-latest
160
+ timeout-minutes: 10
161
+ strategy:
162
+ fail-fast: false
163
+ matrix:
164
+ python-version: ["3.12", "3.13"]
165
+
166
+ steps:
167
+ - name: Checkout repository
168
+ uses: actions/checkout@v7
169
+
170
+ - name: Set up Python ${{ matrix.python-version }}
171
+ uses: actions/setup-python@v7
172
+ with:
173
+ python-version: ${{ matrix.python-version }}
174
+ cache: "pip"
175
+
176
+ - name: Install package with dev dependencies
177
+ run: |
178
+ python -m pip install --upgrade pip
179
+ pip install -e ".[dev]"
180
+
181
+ - name: Run the benchmark in fast mode
182
+ run: make benchmark-fast
183
+
184
+ # The CLI image is a deliverable, not a placeholder: it is the "run the
185
+ # demo without installing anything" path documented in the README, so a
186
+ # broken build or entrypoint must fail CI exactly like a broken wheel.
187
+ # The smoke checks avoid volume mounts because the image's unprivileged
188
+ # uid cannot rely on runner-owned bind-mount permissions.
189
+ docker-image:
190
+ name: Build and smoke-test the CLI image
191
+ runs-on: ubuntu-latest
192
+ timeout-minutes: 15
193
+
194
+ steps:
195
+ - name: Checkout repository
196
+ uses: actions/checkout@v7
197
+
198
+ - name: Build the image
199
+ run: docker build --file docker/Dockerfile --tag forecastforge:ci .
200
+
201
+ - name: Smoke-test the image
202
+ run: |
203
+ docker run --rm forecastforge:ci --version
204
+ docker run --rm forecastforge:ci info
205
+ # The full compute path, entirely inside the container.
206
+ docker run --rm forecastforge:ci pipeline --seed 3 --length 300 \
207
+ --initial-train 120 --models naive,drift
@@ -0,0 +1,81 @@
1
+ name: Docs
2
+
3
+ # Build the MkDocs site and publish it to GitHub Pages on every push to
4
+ # main. The mkdocstrings handler resolves `forecastforge.*` from the source
5
+ # tree (see the `paths` option in mkdocs.yml), but the package is installed
6
+ # anyway so the docstrings are picked up from a real importable checkout and
7
+ # a dependency change that breaks the import fails here, not in review.
8
+
9
+ on:
10
+ push:
11
+ branches: [main]
12
+ paths:
13
+ - "docs/**"
14
+ - "src/**"
15
+ - "mkdocs.yml"
16
+ - ".github/workflows/docs.yml"
17
+ workflow_dispatch: {}
18
+
19
+ permissions:
20
+ contents: read
21
+ pages: write
22
+ id-token: write
23
+
24
+ # Only one Pages deployment at a time; do not cancel an in-flight one, since
25
+ # a cancelled deploy can leave the site stale between pushes.
26
+ concurrency:
27
+ group: pages
28
+ cancel-in-progress: false
29
+
30
+ env:
31
+ PIP_DISABLE_PIP_VERSION_CHECK: "1"
32
+
33
+ jobs:
34
+ build:
35
+ name: Build the site
36
+ runs-on: ubuntu-latest
37
+ timeout-minutes: 10
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v7
42
+
43
+ - name: Set up Python 3.12
44
+ uses: actions/setup-python@v7
45
+ with:
46
+ python-version: "3.12"
47
+ cache: "pip"
48
+
49
+ - name: Install the package with the docs extra
50
+ run: |
51
+ python -m pip install --upgrade pip
52
+ pip install -e ".[docs]"
53
+
54
+ - name: Configure Pages
55
+ # enablement turns Pages on the first time this workflow runs, so no
56
+ # manual repository setting is needed before the first deployment.
57
+ uses: actions/configure-pages@v5
58
+ with:
59
+ enablement: true
60
+
61
+ - name: Build the site (strict)
62
+ run: mkdocs build --strict --site-dir site
63
+
64
+ - name: Upload the site artifact
65
+ uses: actions/upload-pages-artifact@v3
66
+ with:
67
+ path: site
68
+
69
+ deploy:
70
+ name: Deploy to GitHub Pages
71
+ needs: build
72
+ runs-on: ubuntu-latest
73
+ timeout-minutes: 10
74
+ environment:
75
+ name: github-pages
76
+ url: ${{ steps.deployment.outputs.page_url }}
77
+
78
+ steps:
79
+ - name: Deploy the site
80
+ id: deployment
81
+ uses: actions/deploy-pages@v4