Skip to content

Commit

Permalink
♻️ add group_by_all benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdd committed Oct 12, 2023
1 parent 8d0d156 commit 80b28e6
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions tests/benchmarks/test_featurecollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,29 @@ def test_single_series_feature_collection_multiple_descriptors(
benchmark(fc.calculate, dummy_data, n_jobs=n_cores)


@pytest.mark.benchmark(group="group_by collection")
@pytest.mark.benchmark(group="group_by_consecutive collection")
@pytest.mark.parametrize("n_cores", NB_CORES)
@pytest.mark.parametrize("func", FUNCS)
def test_single_series_feature_collection_group_by(
def test_single_series_feature_collection_group_by_consecutive(
benchmark, n_cores, func, dummy_group_data # noqa: F811
):
fd = FeatureDescriptor(function=func, series_name="number_sold")

fc = FeatureCollection(feature_descriptors=fd)

benchmark(fc.calculate, dummy_group_data, group_by="store", n_jobs=n_cores)
benchmark(
fc.calculate, dummy_group_data, group_by_consecutive="store", n_jobs=n_cores
)


@pytest.mark.benchmark(group="group_by_all collection")
@pytest.mark.parametrize("n_cores", NB_CORES)
@pytest.mark.parametrize("func", FUNCS)
def test_single_series_feature_collection_group_by_all(
benchmark, n_cores, func, dummy_group_data # noqa: F811
):
fd = FeatureDescriptor(function=func, series_name="number_sold")

fc = FeatureCollection(feature_descriptors=fd)

benchmark(fc.calculate, dummy_group_data, group_by_all="store", n_jobs=n_cores)

0 comments on commit 80b28e6

Please sign in to comment.