Skip to content

Commit

Permalink
change scope to module
Browse files Browse the repository at this point in the history
  • Loading branch information
wd60622 committed Feb 6, 2024
1 parent 167482f commit a2570ac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/mmm/test_delayed_saturated_mmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
rng: np.random.Generator = np.random.default_rng(seed=seed)


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def generate_data():
def _generate_data(date_data: pd.DatetimeIndex) -> pd.DataFrame:
n: int = date_data.size
Expand All @@ -37,7 +37,7 @@ def _generate_data(date_data: pd.DatetimeIndex) -> pd.DataFrame:
return _generate_data


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def toy_X(generate_data) -> pd.DataFrame:
date_data: pd.DatetimeIndex = pd.date_range(
start="2019-06-01", end="2021-12-31", freq="W-MON"
Expand Down Expand Up @@ -80,12 +80,12 @@ def model_config_requiring_serialization() -> Dict:
return model_config


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def toy_y(toy_X: pd.DataFrame) -> pd.Series:
return pd.Series(data=rng.integers(low=0, high=100, size=toy_X.shape[0]))


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def mmm() -> DelayedSaturatedMMM:
return DelayedSaturatedMMM(
date_column="date",
Expand All @@ -95,7 +95,7 @@ def mmm() -> DelayedSaturatedMMM:
)


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def mmm_with_fourier_features() -> DelayedSaturatedMMM:
return DelayedSaturatedMMM(
date_column="date",
Expand All @@ -106,15 +106,15 @@ def mmm_with_fourier_features() -> DelayedSaturatedMMM:
)


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def mmm_fitted(
mmm: DelayedSaturatedMMM, toy_X: pd.DataFrame, toy_y: pd.Series
) -> DelayedSaturatedMMM:
mmm.fit(X=toy_X, y=toy_y, target_accept=0.8, draws=3, chains=2)
return mmm


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def mmm_fitted_with_fourier_features(
mmm_with_fourier_features: DelayedSaturatedMMM,
toy_X: pd.DataFrame,
Expand Down

0 comments on commit a2570ac

Please sign in to comment.