eb-optimization 0.2.4__tar.gz → 0.2.8__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.
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/LICENSE +1 -1
- {eb_optimization-0.2.4/src/eb_optimization.egg-info → eb_optimization-0.2.8}/PKG-INFO +11 -21
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/README.md +2 -14
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/pyproject.toml +14 -11
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/__init__.py +32 -0
- eb_optimization-0.2.8/src/eb_optimization/policies/__init__.py +71 -0
- eb_optimization-0.2.8/src/eb_optimization/policies/dqc_policy.py +473 -0
- eb_optimization-0.2.8/src/eb_optimization/policies/evaluation.py +146 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/policies/ral_policy.py +236 -35
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/policies/tau_policy.py +14 -17
- eb_optimization-0.2.8/src/eb_optimization/py.typed +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/tuning/cost_ratio.py +35 -56
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/tuning/ral.py +11 -29
- {eb_optimization-0.2.4 → eb_optimization-0.2.8/src/eb_optimization.egg-info}/PKG-INFO +11 -21
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization.egg-info/SOURCES.txt +1 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization.egg-info/requires.txt +6 -4
- eb_optimization-0.2.8/tests/test_public_api.py +107 -0
- eb_optimization-0.2.4/src/eb_optimization/policies/__init__.py +0 -77
- eb_optimization-0.2.4/src/eb_optimization/policies/dqc_policy.py +0 -331
- eb_optimization-0.2.4/src/eb_optimization/policies/evaluation.py +0 -118
- eb_optimization-0.2.4/tests/test_public_api.py +0 -51
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/setup.cfg +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/_utils.py +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/policies/cost_ratio_policy.py +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/search/__init__.py +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/search/grid.py +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/search/kernels.py +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/tuning/__init__.py +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/tuning/sensitivity.py +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization/tuning/tau.py +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization.egg-info/dependency_links.txt +0 -0
- {eb_optimization-0.2.4 → eb_optimization-0.2.8}/src/eb_optimization.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eb-optimization
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
4
4
|
Summary: Electric Barometer: Optimization and tuning utilities for EB objectives and policy parameters.
|
|
5
5
|
Author-email: "Kyle Corrie (Economistician)" <kcorrie@economistician.com>
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -9,21 +9,23 @@ Project-URL: Repository, https://github.com/Economistician/eb-optimization
|
|
|
9
9
|
Project-URL: Issues, https://github.com/Economistician/eb-optimization/issues
|
|
10
10
|
Project-URL: Documentation, https://github.com/Economistician/eb-docs
|
|
11
11
|
Keywords: electric-barometer,optimization,tuning,grid-search,calibration,asymmetric-loss,forecasting,pandas
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
13
|
Classifier: Programming Language :: Python :: 3
|
|
13
14
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
18
|
Classifier: Operating System :: OS Independent
|
|
19
|
-
Requires-Python: >=3.
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: numpy>=1.24
|
|
23
23
|
Requires-Dist: pandas>=2.0
|
|
24
|
+
Requires-Dist: eb-metrics==0.2.9
|
|
25
|
+
Requires-Dist: eb-evaluation==0.2.10
|
|
24
26
|
Provides-Extra: eb
|
|
25
|
-
Requires-Dist: eb-metrics
|
|
26
|
-
Requires-Dist: eb-evaluation
|
|
27
|
+
Requires-Dist: eb-metrics==0.2.9; extra == "eb"
|
|
28
|
+
Requires-Dist: eb-evaluation==0.2.10; extra == "eb"
|
|
27
29
|
Provides-Extra: opt
|
|
28
30
|
Provides-Extra: test
|
|
29
31
|
Requires-Dist: pytest>=8.0; extra == "test"
|
|
@@ -35,8 +37,8 @@ Requires-Dist: ruff>=0.0.1; extra == "dev"
|
|
|
35
37
|
Requires-Dist: pyright>=1.1; extra == "dev"
|
|
36
38
|
Requires-Dist: twine>=4.0; extra == "dev"
|
|
37
39
|
Provides-Extra: all
|
|
38
|
-
Requires-Dist: eb-metrics
|
|
39
|
-
Requires-Dist: eb-evaluation
|
|
40
|
+
Requires-Dist: eb-metrics==0.2.9; extra == "all"
|
|
41
|
+
Requires-Dist: eb-evaluation==0.2.10; extra == "all"
|
|
40
42
|
Requires-Dist: pytest>=8.0; extra == "all"
|
|
41
43
|
Requires-Dist: scikit-learn>=1.3; extra == "all"
|
|
42
44
|
Requires-Dist: pytest-cov>=5.0; extra == "all"
|
|
@@ -58,19 +60,7 @@ Decision and policy layer for the Electric Barometer ecosystem, responsible for
|
|
|
58
60
|
|
|
59
61
|
## Overview
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Rather than computing metrics or running evaluations, this repository focuses on decision logic: how parameters are calibrated, how tradeoffs are resolved, and how those decisions are frozen into auditable artifacts. It provides the bridge between metric theory and operational deployment, ensuring that forecast evaluation behavior is consistent, explainable, and governed by explicit intent rather than ad-hoc configuration.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Role in the Electric Barometer Ecosystem
|
|
68
|
-
|
|
69
|
-
`eb-optimization` defines the parameter selection, calibration, and governance logic used throughout the Electric Barometer ecosystem. It is responsible for determining how key operational parameters—such as cost ratios, tolerance bands, and readiness controls—are selected from data in a disciplined, reproducible, and decision-aware manner.
|
|
70
|
-
|
|
71
|
-
This repository focuses exclusively on optimization mechanics and policy formation. It does not define metric primitives, perform evaluation orchestration, manage model interfaces, or execute runtime decision logic. Those responsibilities are handled by adjacent layers in the ecosystem that compute metrics, evaluate forecasts, or apply frozen policies in production workflows.
|
|
72
|
-
|
|
73
|
-
By separating parameter selection and governance from metric semantics and execution concerns, eb-optimization provides a stable optimization layer that enables consistent calibration, transparent decision rules, and auditable policy artifacts across heterogeneous forecasting and operational contexts.
|
|
63
|
+
`eb-optimization` calibrates operational parameters (cost ratios, τ, readiness controls) and freezes them into auditable runtime policies. It does not compute metrics or run evaluation panels; those belong to `eb-metrics` and `eb-evaluation`.
|
|
74
64
|
|
|
75
65
|
---
|
|
76
66
|
|
|
@@ -131,4 +121,4 @@ print(R)
|
|
|
131
121
|
## License
|
|
132
122
|
|
|
133
123
|
BSD 3-Clause License.
|
|
134
|
-
©
|
|
124
|
+
© 2026 Kyle Corrie.
|
|
@@ -11,19 +11,7 @@ Decision and policy layer for the Electric Barometer ecosystem, responsible for
|
|
|
11
11
|
|
|
12
12
|
## Overview
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Rather than computing metrics or running evaluations, this repository focuses on decision logic: how parameters are calibrated, how tradeoffs are resolved, and how those decisions are frozen into auditable artifacts. It provides the bridge between metric theory and operational deployment, ensuring that forecast evaluation behavior is consistent, explainable, and governed by explicit intent rather than ad-hoc configuration.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Role in the Electric Barometer Ecosystem
|
|
21
|
-
|
|
22
|
-
`eb-optimization` defines the parameter selection, calibration, and governance logic used throughout the Electric Barometer ecosystem. It is responsible for determining how key operational parameters—such as cost ratios, tolerance bands, and readiness controls—are selected from data in a disciplined, reproducible, and decision-aware manner.
|
|
23
|
-
|
|
24
|
-
This repository focuses exclusively on optimization mechanics and policy formation. It does not define metric primitives, perform evaluation orchestration, manage model interfaces, or execute runtime decision logic. Those responsibilities are handled by adjacent layers in the ecosystem that compute metrics, evaluate forecasts, or apply frozen policies in production workflows.
|
|
25
|
-
|
|
26
|
-
By separating parameter selection and governance from metric semantics and execution concerns, eb-optimization provides a stable optimization layer that enables consistent calibration, transparent decision rules, and auditable policy artifacts across heterogeneous forecasting and operational contexts.
|
|
14
|
+
`eb-optimization` calibrates operational parameters (cost ratios, τ, readiness controls) and freezes them into auditable runtime policies. It does not compute metrics or run evaluation panels; those belong to `eb-metrics` and `eb-evaluation`.
|
|
27
15
|
|
|
28
16
|
---
|
|
29
17
|
|
|
@@ -84,4 +72,4 @@ print(R)
|
|
|
84
72
|
## License
|
|
85
73
|
|
|
86
74
|
BSD 3-Clause License.
|
|
87
|
-
©
|
|
75
|
+
© 2026 Kyle Corrie.
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
######################################
|
|
4
4
|
[project]
|
|
5
5
|
name = "eb-optimization"
|
|
6
|
-
version = "0.2.
|
|
6
|
+
version = "0.2.8"
|
|
7
7
|
description = "Electric Barometer: Optimization and tuning utilities for EB objectives and policy parameters."
|
|
8
8
|
readme = "README.md"
|
|
9
|
-
requires-python = ">=3.
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
10
|
license = "BSD-3-Clause"
|
|
11
11
|
license-files = ["LICENSE*"]
|
|
12
12
|
|
|
@@ -26,9 +26,9 @@ keywords = [
|
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
classifiers = [
|
|
29
|
+
"Development Status :: 5 - Production/Stable",
|
|
29
30
|
"Programming Language :: Python :: 3",
|
|
30
31
|
"Programming Language :: Python :: 3 :: Only",
|
|
31
|
-
"Programming Language :: Python :: 3.10",
|
|
32
32
|
"Programming Language :: Python :: 3.11",
|
|
33
33
|
"Programming Language :: Python :: 3.12",
|
|
34
34
|
"Programming Language :: Python :: 3.13",
|
|
@@ -38,11 +38,11 @@ classifiers = [
|
|
|
38
38
|
######################################
|
|
39
39
|
# Core runtime dependencies
|
|
40
40
|
######################################
|
|
41
|
-
# Keep this intentionally lean. eb-optimization should be installable even
|
|
42
|
-
# without pulling the rest of the EB stack unless users opt-in via extras.
|
|
43
41
|
dependencies = [
|
|
44
42
|
"numpy>=1.24",
|
|
45
43
|
"pandas>=2.0",
|
|
44
|
+
"eb-metrics==0.2.9",
|
|
45
|
+
"eb-evaluation==0.2.10",
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
######################################
|
|
@@ -59,11 +59,11 @@ Documentation = "https://github.com/Economistician/eb-docs"
|
|
|
59
59
|
######################################
|
|
60
60
|
[project.optional-dependencies]
|
|
61
61
|
|
|
62
|
-
#
|
|
62
|
+
# EB ecosystem deps (metrics primitives, diagnostics contracts)
|
|
63
|
+
# Use this when you want DQC diagnostics from eb-evaluation and HR@τ primitive from eb-metrics.
|
|
63
64
|
eb = [
|
|
64
|
-
|
|
65
|
-
"eb-
|
|
66
|
-
"eb-evaluation>=0.2,<0.3",
|
|
65
|
+
"eb-metrics==0.2.9",
|
|
66
|
+
"eb-evaluation==0.2.10",
|
|
67
67
|
]
|
|
68
68
|
|
|
69
69
|
# Optional optimization backends (future-proofing)
|
|
@@ -88,8 +88,8 @@ dev = [
|
|
|
88
88
|
# Aggregates EB ecosystem dependencies and test tooling.
|
|
89
89
|
all = [
|
|
90
90
|
# EB ecosystem deps
|
|
91
|
-
"eb-metrics
|
|
92
|
-
"eb-evaluation
|
|
91
|
+
"eb-metrics==0.2.9",
|
|
92
|
+
"eb-evaluation==0.2.10",
|
|
93
93
|
|
|
94
94
|
# test deps
|
|
95
95
|
"pytest>=8.0",
|
|
@@ -115,6 +115,9 @@ build-backend = "setuptools.build_meta"
|
|
|
115
115
|
[tool.setuptools.packages.find]
|
|
116
116
|
where = ["src"]
|
|
117
117
|
|
|
118
|
+
[tool.setuptools.package-data]
|
|
119
|
+
eb_optimization = ["py.typed"]
|
|
120
|
+
|
|
118
121
|
######################################
|
|
119
122
|
# Pytest configuration
|
|
120
123
|
######################################
|
|
@@ -15,12 +15,29 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
from importlib.metadata import PackageNotFoundError, version
|
|
17
17
|
|
|
18
|
+
from .policies.cost_ratio_policy import (
|
|
19
|
+
DEFAULT_COST_RATIO_POLICY,
|
|
20
|
+
CostRatioPolicy,
|
|
21
|
+
apply_cost_ratio_policy,
|
|
22
|
+
)
|
|
23
|
+
from .policies.dqc_policy import (
|
|
24
|
+
DEFAULT_DQC_POLICY,
|
|
25
|
+
DQCPolicy,
|
|
26
|
+
DQCResultSummary,
|
|
27
|
+
compute_dqc,
|
|
28
|
+
enforce_snapping,
|
|
29
|
+
)
|
|
18
30
|
from .policies.ral_policy import (
|
|
19
31
|
DEFAULT_RAL_POLICY,
|
|
32
|
+
RALBands,
|
|
33
|
+
RALBandThresholds,
|
|
20
34
|
RALDeltas,
|
|
35
|
+
RALPolicyArtifact,
|
|
36
|
+
RALThresholdTwoBandPolicy,
|
|
21
37
|
RALTwoBandPolicy,
|
|
22
38
|
apply_ral_policy,
|
|
23
39
|
)
|
|
40
|
+
from .policies.tau_policy import DEFAULT_TAU_POLICY, TauPolicyArtifact, apply_tau_policy
|
|
24
41
|
from .tuning.cost_ratio import EntityCostRatioEstimate
|
|
25
42
|
|
|
26
43
|
|
|
@@ -44,10 +61,25 @@ def _resolve_version() -> str:
|
|
|
44
61
|
__version__ = _resolve_version()
|
|
45
62
|
|
|
46
63
|
__all__ = [
|
|
64
|
+
"DEFAULT_COST_RATIO_POLICY",
|
|
65
|
+
"DEFAULT_DQC_POLICY",
|
|
47
66
|
"DEFAULT_RAL_POLICY",
|
|
67
|
+
"DEFAULT_TAU_POLICY",
|
|
68
|
+
"CostRatioPolicy",
|
|
69
|
+
"DQCPolicy",
|
|
70
|
+
"DQCResultSummary",
|
|
48
71
|
"EntityCostRatioEstimate",
|
|
72
|
+
"RALBandThresholds",
|
|
73
|
+
"RALBands",
|
|
49
74
|
"RALDeltas",
|
|
75
|
+
"RALPolicyArtifact",
|
|
76
|
+
"RALThresholdTwoBandPolicy",
|
|
50
77
|
"RALTwoBandPolicy",
|
|
78
|
+
"TauPolicyArtifact",
|
|
51
79
|
"__version__",
|
|
80
|
+
"apply_cost_ratio_policy",
|
|
52
81
|
"apply_ral_policy",
|
|
82
|
+
"apply_tau_policy",
|
|
83
|
+
"compute_dqc",
|
|
84
|
+
"enforce_snapping",
|
|
53
85
|
]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""Frozen runtime policies (τ, cost ratio, RAL, DQC enforcement).
|
|
2
|
+
|
|
3
|
+
Immutable configuration objects with no learning logic. Prefer
|
|
4
|
+
``eb_evaluation.diagnostics.validate_dqc`` then ``enforce_snapping`` /
|
|
5
|
+
``evaluate_with_dqc_hr``; ``compute_dqc`` remains for compatibility.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .cost_ratio_policy import (
|
|
11
|
+
DEFAULT_COST_RATIO_POLICY,
|
|
12
|
+
CostRatioPolicy,
|
|
13
|
+
apply_cost_ratio_policy,
|
|
14
|
+
apply_entity_cost_ratio_policy,
|
|
15
|
+
)
|
|
16
|
+
from .dqc_policy import (
|
|
17
|
+
DEFAULT_DQC_POLICY,
|
|
18
|
+
DQCPolicy,
|
|
19
|
+
DQCResultSummary,
|
|
20
|
+
compute_dqc,
|
|
21
|
+
enforce_snapping,
|
|
22
|
+
hr_at_tau_grid_units,
|
|
23
|
+
snap_to_grid,
|
|
24
|
+
)
|
|
25
|
+
from .evaluation import DQCEvaluation, evaluate_with_dqc_hr
|
|
26
|
+
from .ral_policy import (
|
|
27
|
+
DEFAULT_RAL_POLICY,
|
|
28
|
+
RALBands,
|
|
29
|
+
RALBandThresholds,
|
|
30
|
+
RALDeltas,
|
|
31
|
+
RALPolicyArtifact,
|
|
32
|
+
RALThresholdTwoBandPolicy,
|
|
33
|
+
RALTwoBandPolicy,
|
|
34
|
+
apply_ral_policy,
|
|
35
|
+
)
|
|
36
|
+
from .tau_policy import (
|
|
37
|
+
DEFAULT_TAU_POLICY,
|
|
38
|
+
TauPolicyArtifact,
|
|
39
|
+
apply_entity_tau_policy,
|
|
40
|
+
apply_tau_policy,
|
|
41
|
+
apply_tau_policy_hr,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
__all__ = [
|
|
45
|
+
"DEFAULT_COST_RATIO_POLICY",
|
|
46
|
+
"DEFAULT_DQC_POLICY",
|
|
47
|
+
"DEFAULT_RAL_POLICY",
|
|
48
|
+
"DEFAULT_TAU_POLICY",
|
|
49
|
+
"CostRatioPolicy",
|
|
50
|
+
"DQCEvaluation",
|
|
51
|
+
"DQCPolicy",
|
|
52
|
+
"DQCResultSummary",
|
|
53
|
+
"RALBandThresholds",
|
|
54
|
+
"RALBands",
|
|
55
|
+
"RALDeltas",
|
|
56
|
+
"RALPolicyArtifact",
|
|
57
|
+
"RALThresholdTwoBandPolicy",
|
|
58
|
+
"RALTwoBandPolicy",
|
|
59
|
+
"TauPolicyArtifact",
|
|
60
|
+
"apply_cost_ratio_policy",
|
|
61
|
+
"apply_entity_cost_ratio_policy",
|
|
62
|
+
"apply_entity_tau_policy",
|
|
63
|
+
"apply_ral_policy",
|
|
64
|
+
"apply_tau_policy",
|
|
65
|
+
"apply_tau_policy_hr",
|
|
66
|
+
"compute_dqc",
|
|
67
|
+
"enforce_snapping",
|
|
68
|
+
"evaluate_with_dqc_hr",
|
|
69
|
+
"hr_at_tau_grid_units",
|
|
70
|
+
"snap_to_grid",
|
|
71
|
+
]
|