in trend_getter/scenarios.py [0:0]
def __post_init__(self) -> None:
if "_" in self.slug:
raise ValueError("slug cannot contain '_'.")
if self.slug in ["total", "other"]:
raise ValueError("slug cannot use the name 'total' or 'other'.")
self.start_date = pd.to_datetime(self.start_date)
self.end_date = pd.to_datetime(self.end_date)
self.query_select = f"IFNULL({self.population}, FALSE) AS {self.slug},"
self.cdf = interp1d(
self.cdf_x, self.cdf_y, kind="linear", bounds_error=False, fill_value=(0, 1)
)
self.quantile = interp1d(
self.cdf_y, self.cdf_x, kind="linear", bounds_error=False, fill_value=(0, 1)
)