config
Centralized configuration for time estimation.
This module consolidates all estimation-related configuration that was previously scattered across multiple files as magic numbers.
The EstimationConfig dataclass contains all thresholds, multipliers, and settings used by the time estimation system.
Classes¶
ConfidenceThresholds
dataclass
¶
Thresholds for confidence-based decisions.
Attributes:
| Name | Type | Description |
|---|---|---|
size_scaling_min |
float
|
Min confidence to use size-scaled estimate. |
high_confidence |
float
|
Show simple estimate without range. |
medium_confidence |
float
|
Show range. |
low_confidence |
float
|
Show "rough" caveat. |
max_confidence |
float
|
Cap to avoid overconfidence. |
bootstrap_confidence |
float
|
Confidence when no progress yet. |
Source code in snakesee/state/config.py
ConfidenceWeights
dataclass
¶
Weights for computing overall confidence score.
Used in _estimate_weighted() to combine multiple factors. All weights should sum to 1.0.
Attributes:
| Name | Type | Description |
|---|---|---|
sample_size |
float
|
Weight for historical sample count. |
recency |
float
|
Weight for data recency. |
consistency |
float
|
Weight for recent run consistency. |
data_coverage |
float
|
Weight for fraction of rules with data. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If weights do not sum to 1.0. |
Source code in snakesee/state/config.py
EstimationConfig
dataclass
¶
Central configuration for time estimation.
This class consolidates all estimation-related configuration that was previously scattered across multiple files as magic numbers.
Attributes:
| Name | Type | Description |
|---|---|---|
weighting_strategy |
WeightingStrategy
|
How to weight historical data ("time" or "index"). |
half_life_days |
float
|
Half-life in days for time-based weighting. |
half_life_logs |
int
|
Half-life in run count for index-based weighting. |
variance |
VarianceMultipliers
|
Variance multiplier settings. |
confidence_weights |
ConfidenceWeights
|
Weights for confidence calculation. |
confidence_thresholds |
ConfidenceThresholds
|
Decision thresholds based on confidence. |
time |
TimeConstants
|
Time-related constants. |
min_samples_for_conditioning |
int
|
Minimum samples for wildcard conditioning. |
min_pairs_for_size_scaling |
int
|
Minimum pairs for size correlation. |
high_variance_cv |
float
|
Coefficient of variation threshold for "high variance". |
default_global_mean |
float
|
Fallback duration when no data available. |
Raises: ValueError: If any parameter is invalid (e.g., non-positive half_life).
Source code in snakesee/state/config.py
Functions¶
__post_init__ ¶
Validate configuration parameters.
Source code in snakesee/state/config.py
TimeConstants
dataclass
¶
Time-related constants used throughout the codebase.
Attributes:
| Name | Type | Description |
|---|---|---|
seconds_per_day |
int
|
Number of seconds in a day. |
seconds_per_hour |
int
|
Number of seconds in an hour. |
seconds_per_minute |
int
|
Number of seconds in a minute. |
stale_workflow_threshold |
float
|
Seconds before workflow is considered stale. |
timing_mismatch_tolerance |
float
|
Tolerance for validation timing comparisons. |
Source code in snakesee/state/config.py
VarianceMultipliers
dataclass
¶
Variance multipliers for different estimation scenarios.
When only one observation exists, variance is computed as (mean * multiplier)^2. Lower multipliers = tighter confidence bounds.
Attributes:
| Name | Type | Description |
|---|---|---|
exact_thread_match |
float
|
High confidence - exact thread count match. |
exact_wildcard_match |
float
|
High confidence - exact wildcard match. |
size_scaled |
float
|
Medium confidence - input-size scaling. |
rule_fallback |
float
|
Standard - rule-level fallback. |
aggregate_fallback |
float
|
Standard - aggregate across thread counts. |
fuzzy_match |
float
|
Lower confidence - fuzzy rule matching. |
global_fallback |
float
|
Lowest confidence - no rule data. |
bootstrap |
float
|
No progress yet - initial estimate. |