forecastops 0.1.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.
- forecastops-0.1.0/.github/workflows/ci.yml +23 -0
- forecastops-0.1.0/.github/workflows/release.yml +25 -0
- forecastops-0.1.0/.gitignore +18 -0
- forecastops-0.1.0/CHANGELOG.md +42 -0
- forecastops-0.1.0/LICENSE +202 -0
- forecastops-0.1.0/PKG-INFO +150 -0
- forecastops-0.1.0/README.md +105 -0
- forecastops-0.1.0/examples/README.md +10 -0
- forecastops-0.1.0/examples/_synthetic.py +42 -0
- forecastops-0.1.0/examples/generic_dataframe.py +30 -0
- forecastops-0.1.0/examples/lightgbm_array.py +30 -0
- forecastops-0.1.0/examples/local_ui_demo.py +29 -0
- forecastops-0.1.0/examples/nixtla_multiseries.py +43 -0
- forecastops-0.1.0/examples/otel_console.py +32 -0
- forecastops-0.1.0/examples/prophet_one_line.py +31 -0
- forecastops-0.1.0/forecastops/__init__.py +24 -0
- forecastops-0.1.0/forecastops/adapters/__init__.py +2 -0
- forecastops-0.1.0/forecastops/adapters/base.py +16 -0
- forecastops-0.1.0/forecastops/adapters/darts.py +60 -0
- forecastops-0.1.0/forecastops/adapters/dataframe.py +64 -0
- forecastops-0.1.0/forecastops/adapters/gluonts.py +64 -0
- forecastops-0.1.0/forecastops/adapters/nixtla.py +51 -0
- forecastops-0.1.0/forecastops/adapters/prophet.py +38 -0
- forecastops-0.1.0/forecastops/adapters/registry.py +59 -0
- forecastops-0.1.0/forecastops/adapters/sklearn.py +28 -0
- forecastops-0.1.0/forecastops/cli/__init__.py +2 -0
- forecastops-0.1.0/forecastops/cli/main.py +229 -0
- forecastops-0.1.0/forecastops/core/__init__.py +2 -0
- forecastops-0.1.0/forecastops/core/capture.py +220 -0
- forecastops-0.1.0/forecastops/core/compare.py +205 -0
- forecastops-0.1.0/forecastops/core/config.py +110 -0
- forecastops-0.1.0/forecastops/core/diff.py +90 -0
- forecastops-0.1.0/forecastops/core/evaluate.py +328 -0
- forecastops-0.1.0/forecastops/core/normalize.py +235 -0
- forecastops-0.1.0/forecastops/core/report.py +182 -0
- forecastops-0.1.0/forecastops/core/run.py +127 -0
- forecastops-0.1.0/forecastops/core/schema.py +84 -0
- forecastops-0.1.0/forecastops/core/validate.py +334 -0
- forecastops-0.1.0/forecastops/core/wrappers.py +86 -0
- forecastops-0.1.0/forecastops/otel/__init__.py +6 -0
- forecastops-0.1.0/forecastops/otel/events.py +28 -0
- forecastops-0.1.0/forecastops/otel/exporters.py +47 -0
- forecastops-0.1.0/forecastops/otel/metrics.py +101 -0
- forecastops-0.1.0/forecastops/otel/semconv.py +42 -0
- forecastops-0.1.0/forecastops/otel/trace.py +78 -0
- forecastops-0.1.0/forecastops/store/__init__.py +2 -0
- forecastops-0.1.0/forecastops/store/duckdb_index.py +376 -0
- forecastops-0.1.0/forecastops/store/local.py +52 -0
- forecastops-0.1.0/forecastops/store/manifest.py +29 -0
- forecastops-0.1.0/forecastops/store/parquet.py +64 -0
- forecastops-0.1.0/forecastops/ui/__init__.py +2 -0
- forecastops-0.1.0/forecastops/ui/queries.py +246 -0
- forecastops-0.1.0/forecastops/ui/server.py +113 -0
- forecastops-0.1.0/forecastops/ui/static/app.js +885 -0
- forecastops-0.1.0/forecastops/ui/static/index.html +39 -0
- forecastops-0.1.0/forecastops/ui/static/styles.css +749 -0
- forecastops-0.1.0/pyproject.toml +79 -0
- forecastops-0.1.0/tests/conftest.py +21 -0
- forecastops-0.1.0/tests/test_capture_report_ui.py +79 -0
- forecastops-0.1.0/tests/test_cli.py +13 -0
- forecastops-0.1.0/tests/test_cli_commands.py +163 -0
- forecastops-0.1.0/tests/test_core_correctness.py +251 -0
- forecastops-0.1.0/tests/test_evaluate_compare.py +56 -0
- forecastops-0.1.0/tests/test_normalization_and_validation.py +99 -0
- forecastops-0.1.0/tests/test_otel_export.py +192 -0
- forecastops-0.1.0/tests/test_store_and_queries.py +204 -0
- forecastops-0.1.0/tests/test_wrappers_and_optional_adapters.py +117 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: ${{ matrix.python-version }}
|
|
18
|
+
cache: pip
|
|
19
|
+
- run: python -m pip install --upgrade pip
|
|
20
|
+
- run: pip install -e ".[dev]"
|
|
21
|
+
- run: ruff check .
|
|
22
|
+
- run: mypy forecastops
|
|
23
|
+
- run: pytest --cov=forecastops --cov-report=term-missing
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.12"
|
|
16
|
+
- run: python -m pip install --upgrade pip build
|
|
17
|
+
- run: pip install -e ".[dev]"
|
|
18
|
+
- run: ruff check .
|
|
19
|
+
- run: mypy forecastops
|
|
20
|
+
- run: pytest
|
|
21
|
+
- run: python -m build
|
|
22
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
23
|
+
with:
|
|
24
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
25
|
+
skip-existing: true
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 — 2026-06-11
|
|
4
|
+
|
|
5
|
+
Initial public release.
|
|
6
|
+
|
|
7
|
+
### Highlights
|
|
8
|
+
|
|
9
|
+
- `fops.capture()` normalizes forecasts from existing pipelines into local
|
|
10
|
+
Parquet artifacts with a DuckDB run index; `evaluate`, `compare`, and `diff`
|
|
11
|
+
compute horizon-aware metrics, benchmark skill, and run-to-run deltas.
|
|
12
|
+
- Local read-only UI (`fops ui`) with Runs, run detail (per-series forecast
|
|
13
|
+
inspector), Projects (error trends across captures), and Compare views.
|
|
14
|
+
- Static HTML reports (`fops report`) and an `fops` CLI for capture, lint,
|
|
15
|
+
evaluate, diff, and report workflows.
|
|
16
|
+
- Optional OpenTelemetry export of aggregate metrics and capture traces —
|
|
17
|
+
off by default, never includes raw forecast points.
|
|
18
|
+
|
|
19
|
+
### Hardening before release
|
|
20
|
+
|
|
21
|
+
- Merges between forecasts and actuals/benchmarks now align timezones,
|
|
22
|
+
reject duplicate join keys with a clear error, and warn when a join
|
|
23
|
+
matches zero rows instead of silently reporting nothing.
|
|
24
|
+
- Benchmarked captures no longer evaluate twice, keep the `count` metric,
|
|
25
|
+
and aggregate views report model-side metrics (benchmark values are
|
|
26
|
+
reported separately).
|
|
27
|
+
- Read connections retry while a capture holds the DuckDB write lock, so
|
|
28
|
+
the UI and reports work during captures.
|
|
29
|
+
- UI queries push filters into DuckDB instead of loading whole Parquet
|
|
30
|
+
artifacts, and residuals are computed over the full artifact (previously
|
|
31
|
+
silently truncated at 10,000 points).
|
|
32
|
+
- OpenTelemetry metrics actually export through the global meter provider
|
|
33
|
+
(gauges, so negative values like bias work); traces and metrics share one
|
|
34
|
+
config-driven enable switch; `forecastops.otel.configure_console_export()`
|
|
35
|
+
sets up a console exporter for local testing.
|
|
36
|
+
- The UI refuses to bind to non-loopback hosts unless `--allow-remote` is
|
|
37
|
+
passed.
|
|
38
|
+
- `ForecastSchema.from_dict` rejects unknown keys; quantile column detection
|
|
39
|
+
no longer mangles columns like `yhat_pred`; `@fops.forecast` returns the
|
|
40
|
+
wrapped function's original output (pass `return_run=True` for the run);
|
|
41
|
+
`evaluate`/`compare`/`diff` accept frames without a `run_id`.
|
|
42
|
+
- Removed the unused `jinja2` dependency.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. Do not include
|
|
183
|
+
the brackets. The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: forecastops
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local-first observability, evaluation, and UI for production forecasts.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Parisi-Labs/forecastops
|
|
6
|
+
Project-URL: Repository, https://github.com/Parisi-Labs/forecastops
|
|
7
|
+
Project-URL: Changelog, https://github.com/Parisi-Labs/forecastops/blob/main/CHANGELOG.md
|
|
8
|
+
Project-URL: Issues, https://github.com/Parisi-Labs/forecastops/issues
|
|
9
|
+
Author: ForecastOps contributors
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: duckdb,evaluation,forecasting,observability,opentelemetry
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: duckdb>=1.0
|
|
24
|
+
Requires-Dist: fastapi>=0.111
|
|
25
|
+
Requires-Dist: numpy>=1.24
|
|
26
|
+
Requires-Dist: opentelemetry-api>=1.24
|
|
27
|
+
Requires-Dist: pandas>=2.0
|
|
28
|
+
Requires-Dist: pyarrow>=15.0
|
|
29
|
+
Requires-Dist: python-dateutil>=2.8
|
|
30
|
+
Requires-Dist: pyyaml>=6.0
|
|
31
|
+
Requires-Dist: typer>=0.12
|
|
32
|
+
Requires-Dist: uvicorn>=0.29
|
|
33
|
+
Provides-Extra: all
|
|
34
|
+
Requires-Dist: opentelemetry-sdk>=1.24; extra == 'all'
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: httpx>=0.27; extra == 'dev'
|
|
37
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
38
|
+
Requires-Dist: opentelemetry-sdk>=1.24; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest>=8.2; extra == 'dev'
|
|
41
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
42
|
+
Provides-Extra: otel
|
|
43
|
+
Requires-Dist: opentelemetry-sdk>=1.24; extra == 'otel'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# ForecastOps
|
|
47
|
+
|
|
48
|
+
ForecastOps is a local-first observability and evaluation layer for
|
|
49
|
+
production forecasts. It works with the forecasting code you already have.
|
|
50
|
+
|
|
51
|
+
Add one line after `.predict()`, then run `fops ui`.
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import forecastops as fops
|
|
55
|
+
|
|
56
|
+
forecast = model.predict(future)
|
|
57
|
+
|
|
58
|
+
run = fops.capture(
|
|
59
|
+
forecast,
|
|
60
|
+
project="site-traffic",
|
|
61
|
+
series_id="homepage",
|
|
62
|
+
cutoff=train_df["ds"].max(),
|
|
63
|
+
actuals=actuals_df,
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
fops ui
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
ForecastOps stores forecast artifacts locally as Parquet, writes run metadata
|
|
72
|
+
to DuckDB, computes horizon-aware metrics, generates static HTML reports, and
|
|
73
|
+
serves a read-only local UI. It does not train forecasting models, require a
|
|
74
|
+
cloud account, or upload raw forecast data.
|
|
75
|
+
|
|
76
|
+
## Install
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pip install forecastops
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
From source:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git clone https://github.com/Parisi-Labs/forecastops.git
|
|
86
|
+
cd forecastops
|
|
87
|
+
pip install -e .
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Quickstart
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
python -m venv .venv
|
|
94
|
+
source .venv/bin/activate
|
|
95
|
+
pip install -e .
|
|
96
|
+
python examples/generic_dataframe.py
|
|
97
|
+
fops report --latest
|
|
98
|
+
fops ui
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Open [http://127.0.0.1:4784](http://127.0.0.1:4784) after starting the UI.
|
|
102
|
+
|
|
103
|
+
## Local UI
|
|
104
|
+
|
|
105
|
+
`fops ui` serves a read-only explorer for the local store:
|
|
106
|
+
|
|
107
|
+
- **Runs** — every captured run with horizon, points, MAE, WAPE, bias,
|
|
108
|
+
coverage, skill, and validation status; filterable and sortable.
|
|
109
|
+
- **Run detail** — headline metrics, a forecast inspector with one chart per
|
|
110
|
+
series (forecast vs. actual vs. benchmark with interval bands), metrics,
|
|
111
|
+
validation events, residuals, artifacts, and the capture trace timeline.
|
|
112
|
+
- **Projects** — runs grouped by project with error trends across captures.
|
|
113
|
+
- **Compare** — metric deltas and regressions between any two runs, backed
|
|
114
|
+
by `fops diff`.
|
|
115
|
+
|
|
116
|
+
## Core Concepts
|
|
117
|
+
|
|
118
|
+
- `capture`: normalize forecasts from existing workflows.
|
|
119
|
+
- `ForecastSchema`: map arbitrary dataframe columns to canonical semantics.
|
|
120
|
+
- `validate`: catch schema, timestamp, duplicate, interval, and leakage issues.
|
|
121
|
+
- `evaluate`: compute MAE, RMSE, WAPE, bias, coverage, interval width, and count.
|
|
122
|
+
- `compare`: calculate benchmark metrics and skill.
|
|
123
|
+
- `diff`: compare two captured runs.
|
|
124
|
+
- local store: `.forecastops/forecastops.duckdb` plus Parquet artifacts.
|
|
125
|
+
- UI: local read-only browser explorer for runs, metrics, residuals, validation,
|
|
126
|
+
artifacts, and run differences.
|
|
127
|
+
|
|
128
|
+
## Privacy Defaults
|
|
129
|
+
|
|
130
|
+
ForecastOps is local-first by default:
|
|
131
|
+
|
|
132
|
+
- binds the UI to `127.0.0.1` and refuses other hosts unless you pass
|
|
133
|
+
`--allow-remote`
|
|
134
|
+
- makes no outbound network calls
|
|
135
|
+
- stores raw forecast points in the configured local store
|
|
136
|
+
- emits OpenTelemetry only when explicitly enabled
|
|
137
|
+
- avoids raw forecast points in telemetry
|
|
138
|
+
|
|
139
|
+
## Development
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pip install -e ".[dev]"
|
|
143
|
+
pytest
|
|
144
|
+
ruff check .
|
|
145
|
+
mypy forecastops
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# ForecastOps
|
|
2
|
+
|
|
3
|
+
ForecastOps is a local-first observability and evaluation layer for
|
|
4
|
+
production forecasts. It works with the forecasting code you already have.
|
|
5
|
+
|
|
6
|
+
Add one line after `.predict()`, then run `fops ui`.
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
import forecastops as fops
|
|
10
|
+
|
|
11
|
+
forecast = model.predict(future)
|
|
12
|
+
|
|
13
|
+
run = fops.capture(
|
|
14
|
+
forecast,
|
|
15
|
+
project="site-traffic",
|
|
16
|
+
series_id="homepage",
|
|
17
|
+
cutoff=train_df["ds"].max(),
|
|
18
|
+
actuals=actuals_df,
|
|
19
|
+
)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
fops ui
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
ForecastOps stores forecast artifacts locally as Parquet, writes run metadata
|
|
27
|
+
to DuckDB, computes horizon-aware metrics, generates static HTML reports, and
|
|
28
|
+
serves a read-only local UI. It does not train forecasting models, require a
|
|
29
|
+
cloud account, or upload raw forecast data.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install forecastops
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
From source:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/Parisi-Labs/forecastops.git
|
|
41
|
+
cd forecastops
|
|
42
|
+
pip install -e .
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quickstart
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
python -m venv .venv
|
|
49
|
+
source .venv/bin/activate
|
|
50
|
+
pip install -e .
|
|
51
|
+
python examples/generic_dataframe.py
|
|
52
|
+
fops report --latest
|
|
53
|
+
fops ui
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Open [http://127.0.0.1:4784](http://127.0.0.1:4784) after starting the UI.
|
|
57
|
+
|
|
58
|
+
## Local UI
|
|
59
|
+
|
|
60
|
+
`fops ui` serves a read-only explorer for the local store:
|
|
61
|
+
|
|
62
|
+
- **Runs** — every captured run with horizon, points, MAE, WAPE, bias,
|
|
63
|
+
coverage, skill, and validation status; filterable and sortable.
|
|
64
|
+
- **Run detail** — headline metrics, a forecast inspector with one chart per
|
|
65
|
+
series (forecast vs. actual vs. benchmark with interval bands), metrics,
|
|
66
|
+
validation events, residuals, artifacts, and the capture trace timeline.
|
|
67
|
+
- **Projects** — runs grouped by project with error trends across captures.
|
|
68
|
+
- **Compare** — metric deltas and regressions between any two runs, backed
|
|
69
|
+
by `fops diff`.
|
|
70
|
+
|
|
71
|
+
## Core Concepts
|
|
72
|
+
|
|
73
|
+
- `capture`: normalize forecasts from existing workflows.
|
|
74
|
+
- `ForecastSchema`: map arbitrary dataframe columns to canonical semantics.
|
|
75
|
+
- `validate`: catch schema, timestamp, duplicate, interval, and leakage issues.
|
|
76
|
+
- `evaluate`: compute MAE, RMSE, WAPE, bias, coverage, interval width, and count.
|
|
77
|
+
- `compare`: calculate benchmark metrics and skill.
|
|
78
|
+
- `diff`: compare two captured runs.
|
|
79
|
+
- local store: `.forecastops/forecastops.duckdb` plus Parquet artifacts.
|
|
80
|
+
- UI: local read-only browser explorer for runs, metrics, residuals, validation,
|
|
81
|
+
artifacts, and run differences.
|
|
82
|
+
|
|
83
|
+
## Privacy Defaults
|
|
84
|
+
|
|
85
|
+
ForecastOps is local-first by default:
|
|
86
|
+
|
|
87
|
+
- binds the UI to `127.0.0.1` and refuses other hosts unless you pass
|
|
88
|
+
`--allow-remote`
|
|
89
|
+
- makes no outbound network calls
|
|
90
|
+
- stores raw forecast points in the configured local store
|
|
91
|
+
- emits OpenTelemetry only when explicitly enabled
|
|
92
|
+
- avoids raw forecast points in telemetry
|
|
93
|
+
|
|
94
|
+
## Development
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install -e ".[dev]"
|
|
98
|
+
pytest
|
|
99
|
+
ruff check .
|
|
100
|
+
mypy forecastops
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def daily_demand(periods: int = 90, *, series_id: str = "sku-001", seed: int = 7) -> pd.DataFrame:
|
|
8
|
+
rng = np.random.default_rng(seed)
|
|
9
|
+
ds = pd.date_range("2026-01-01", periods=periods, freq="D")
|
|
10
|
+
trend = np.linspace(100, 120, periods)
|
|
11
|
+
seasonality = 12 * np.sin(np.arange(periods) / 7 * 2 * np.pi)
|
|
12
|
+
noise = rng.normal(0, 3, periods)
|
|
13
|
+
return pd.DataFrame({"series_id": series_id, "ds": ds, "y": trend + seasonality + noise})
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def forecast_from_history(history: pd.DataFrame, horizon: int = 21, *, seed: int = 9) -> tuple[pd.DataFrame, pd.DataFrame]:
|
|
17
|
+
rng = np.random.default_rng(seed)
|
|
18
|
+
cutoff = history["ds"].max()
|
|
19
|
+
future_ds = pd.date_range(cutoff + pd.Timedelta(days=1), periods=horizon, freq="D")
|
|
20
|
+
base = history["y"].tail(14).mean()
|
|
21
|
+
seasonal = 10 * np.sin((np.arange(horizon) + len(history)) / 7 * 2 * np.pi)
|
|
22
|
+
yhat = base + seasonal + np.linspace(0, 4, horizon)
|
|
23
|
+
actual = yhat + rng.normal(0, 4, horizon)
|
|
24
|
+
forecast = pd.DataFrame(
|
|
25
|
+
{
|
|
26
|
+
"series_id": history["series_id"].iloc[0],
|
|
27
|
+
"target_time": future_ds,
|
|
28
|
+
"prediction": yhat,
|
|
29
|
+
"yhat_lower": yhat - 9,
|
|
30
|
+
"yhat_upper": yhat + 9,
|
|
31
|
+
"region": "north",
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
actuals = pd.DataFrame(
|
|
35
|
+
{
|
|
36
|
+
"series_id": history["series_id"].iloc[0],
|
|
37
|
+
"target_time": future_ds,
|
|
38
|
+
"actual": actual,
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
return forecast, actuals
|
|
42
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from _synthetic import daily_demand, forecast_from_history
|
|
4
|
+
|
|
5
|
+
import forecastops as fops
|
|
6
|
+
from forecastops.core.report import report
|
|
7
|
+
|
|
8
|
+
history = daily_demand()
|
|
9
|
+
forecast_df, actuals_df = forecast_from_history(history)
|
|
10
|
+
|
|
11
|
+
run = fops.capture(
|
|
12
|
+
forecast_df,
|
|
13
|
+
project="demand",
|
|
14
|
+
schema=fops.ForecastSchema(
|
|
15
|
+
series_id="series_id",
|
|
16
|
+
target_time="target_time",
|
|
17
|
+
prediction="prediction",
|
|
18
|
+
lower="yhat_lower",
|
|
19
|
+
upper="yhat_upper",
|
|
20
|
+
extra_columns=["region"],
|
|
21
|
+
),
|
|
22
|
+
cutoff=history["ds"].max(),
|
|
23
|
+
actuals=actuals_df,
|
|
24
|
+
model_name="seasonal-baseline",
|
|
25
|
+
model_version="2026.06",
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
report_path = report(run)
|
|
29
|
+
print({"run_id": run.run_id, "status": run.status, "report": str(report_path)})
|
|
30
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
import forecastops as fops
|
|
7
|
+
|
|
8
|
+
cutoff = pd.Timestamp("2026-05-01")
|
|
9
|
+
target_time = pd.date_range(cutoff + pd.Timedelta(hours=1), periods=24, freq="h")
|
|
10
|
+
preds = np.linspace(50, 60, len(target_time)) + np.sin(np.arange(len(target_time)))
|
|
11
|
+
actuals = pd.DataFrame(
|
|
12
|
+
{
|
|
13
|
+
"target_time": target_time,
|
|
14
|
+
"actual": preds + np.random.default_rng(4).normal(0, 1.5, len(target_time)),
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
run = fops.capture(
|
|
19
|
+
preds,
|
|
20
|
+
adapter="array",
|
|
21
|
+
project="array-demo",
|
|
22
|
+
series_id="meter-17",
|
|
23
|
+
cutoff=cutoff,
|
|
24
|
+
target_time=target_time,
|
|
25
|
+
model_name="lightgbm",
|
|
26
|
+
actuals=actuals,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
print({"run_id": run.run_id, "status": run.status})
|
|
30
|
+
|