Skip to content

REF: include CategoricalIndex in index_cached parametrization #32215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ def setup(self):
def time_get_loc(self):
self.index.get_loc(self.category)

def time_shape(self):
self.index.shape

def time_shallow_copy(self):
self.index._shallow_copy()

Expand Down
3 changes: 3 additions & 0 deletions asv_bench/benchmarks/index_cached_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class IndexCache:

params = [
[
"CategoricalIndex",
"DatetimeIndex",
"Float64Index",
"IntervalIndex",
Expand Down Expand Up @@ -42,6 +43,8 @@ def setup(self, index_type):
self.idx = pd.Float64Index(range(N))
elif index_type == "UInt64Index":
self.idx = pd.UInt64Index(range(N))
elif index_type == "CategoricalIndex":
self.idx = pd.CategoricalIndex(range(N), range(N))
else:
raise ValueError
assert len(self.idx) == N
Expand Down
8 changes: 0 additions & 8 deletions asv_bench/benchmarks/index_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ def time_datetime_difference_disjoint(self):
self.datetime_left.difference(self.datetime_right)


class Datetime:
def setup(self):
self.dr = date_range("20000101", freq="D", periods=10000)

def time_is_dates_only(self):
self.dr._is_dates_only


class Range:
def setup(self):
self.idx_inc = RangeIndex(start=0, stop=10 ** 7, step=3)
Expand Down
5 changes: 5 additions & 0 deletions asv_bench/benchmarks/indexing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
These benchmarks are for Series and DataFrame indexing methods. For the
lower-level methods directly on Index and subclasses, see index_object.py,
indexing_engine.py, and index_cached.py
"""
import warnings

import numpy as np
Expand Down
3 changes: 0 additions & 3 deletions asv_bench/benchmarks/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ def setup(self):
def time_get_loc(self):
self.index.get_loc(self.period)

def time_shape(self):
self.index.shape

def time_shallow_copy(self):
self.index._shallow_copy()

Expand Down
3 changes: 0 additions & 3 deletions asv_bench/benchmarks/timedelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ def setup(self):
def time_get_loc(self):
self.index.get_loc(self.timedelta)

def time_shape(self):
self.index.shape

def time_shallow_copy(self):
self.index._shallow_copy()

Expand Down
3 changes: 3 additions & 0 deletions asv_bench/benchmarks/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def time_to_date(self, index_type):
def time_to_pydatetime(self, index_type):
self.index.to_pydatetime()

def time_is_dates_only(self, index_type):
self.index._is_dates_only


class TzLocalize:

Expand Down