Skip to content

Commit

Permalink
✔️ test n_jobs for group_by behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdd committed Oct 14, 2023
1 parent 6c61ec9 commit 1bb69cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_features_feature_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def test_single_series_group_feature_non_existent_group_by(


@pytest.mark.parametrize("group_by", ["group_by_all", "group_by_consecutive"])
def test_single_series_multiple_features_group_by(dummy_group_data, group_by):
@pytest.mark.parametrize("n_jobs", [1, 3])
def test_single_series_multiple_features_group_by(dummy_group_data, group_by, n_jobs):
fd1 = FeatureDescriptor(function=np.sum, series_name="number_sold")
fd2 = FeatureDescriptor(function=np.min, series_name="number_sold")
fd3 = FeatureDescriptor(function=np.max, series_name="number_sold")
Expand All @@ -140,10 +141,10 @@ def test_single_series_multiple_features_group_by(dummy_group_data, group_by):
assert fc.get_nb_output_features() == 3

res_list = fc.calculate(
dummy_group_data, return_df=False, n_jobs=1, **{group_by: "store"}
dummy_group_data, return_df=False, n_jobs=n_jobs, **{group_by: "store"}
)
res_df = fc.calculate(
dummy_group_data, return_df=True, n_jobs=1, **{group_by: "store"}
dummy_group_data, return_df=True, n_jobs=n_jobs, **{group_by: "store"}
)

assert isinstance(res_list, list)
Expand Down

0 comments on commit 1bb69cd

Please sign in to comment.