use antecedent_core::{AverageEffectQuery, ExecutionContext};
use antecedent_data::TabularData;
use antecedent_expr::IdentifiedEstimand;
use crate::adjustment::{EffectEstimate, EstimationWorkspace, PreparedEstimationProblem};
use crate::error::EstimationError;
mod sealed {
pub trait Sealed {}
}
impl sealed::Sealed for crate::adjustment::LinearAdjustmentAte {}
pub trait Estimator<D, Q = AverageEffectQuery>: sealed::Sealed {
type Fit;
fn prepare(
&self,
data: &D,
estimand: &IdentifiedEstimand,
query: &Q,
ctx: &ExecutionContext,
) -> Result<PreparedEstimationProblem, EstimationError>;
fn fit(
&self,
problem: &PreparedEstimationProblem,
workspace: &mut EstimationWorkspace,
ctx: &ExecutionContext,
) -> Result<Self::Fit, EstimationError>;
}
pub trait TabularAteEstimator:
Estimator<TabularData, AverageEffectQuery, Fit = EffectEstimate>
{
}