Summary
Provide a single-entry-point dispatcher matching the Python scoring.py pattern, so users can call score(:crps, obs, fct) without importing individual functions.
Proposed API
"""
score(metric::Symbol, obs, fct; kwargs...) -> Float64
Compute the scoring rule specified by `metric`.
Supported metrics: :crps, :energy, :wis, :brier, :log, :rmse, :mae, :coverage.
"""
function score(metric::Symbol, obs, fct; kwargs...)
# dispatch to specialized implementations
end
Alternatively, use a type-dispatch approach:
abstract type AbstractScoringRule end
struct CRPS <: AbstractScoringRule end
score(::CRPS, obs, fct) = crps_ensemble(obs, fct)
Design Notes
- Type dispatch is more Julian and extensible.
- Symbol dispatch is simpler for interactive use.
- Consider supporting both:
score(:crps, ...) as sugar for score(CRPS(), ...).
Depends On
Acceptance Criteria
Summary
Provide a single-entry-point dispatcher matching the Python
scoring.pypattern, so users can callscore(:crps, obs, fct)without importing individual functions.Proposed API
Alternatively, use a type-dispatch approach:
Design Notes
score(:crps, ...)as sugar forscore(CRPS(), ...).Depends On
Acceptance Criteria
score()