Skip to content

TST: split up tests/plotting/test_frame.py into subdir & modules #34769 #37538

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

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
7847116
Moving the file test_frame.py to a new directory
Mikhaylov-yv Oct 31, 2020
418551a
Сreated file test_frame_color.py
Mikhaylov-yv Nov 1, 2020
8f6cde0
Transfer tests
Mikhaylov-yv Nov 2, 2020
2cb3fd7
PEP 8 fixes
Mikhaylov-yv Nov 2, 2020
4527f11
Transfer tests
Mikhaylov-yv Nov 2, 2020
d851ca2
Removing unnecessary imports
Mikhaylov-yv Nov 2, 2020
d350978
Merge branch 'master' into #34769_TST_split_up_tests
Mikhaylov-yv Nov 2, 2020
d5ddae2
PEP 8 fixes
Mikhaylov-yv Nov 2, 2020
aeacf6c
Fixed class name
Mikhaylov-yv Nov 4, 2020
d9c8ae9
Transfer tests
Mikhaylov-yv Nov 4, 2020
807bda2
catch FutureWarnings (#37587)
jbrockmendel Nov 2, 2020
330b74a
TST/REF: collect indexing tests by method (#37590)
jbrockmendel Nov 2, 2020
3cd5b65
REF: prelims for single-path setitem_with_indexer (#37588)
jbrockmendel Nov 2, 2020
d2d892a
ENH: __repr__ for 2D DTA/TDA (#37164)
jbrockmendel Nov 2, 2020
aaced3f
CLN: de-duplicate _validate_where_value with _validate_setitem_value …
jbrockmendel Nov 2, 2020
b964dd7
TST/REF: collect tests by method (#37589)
jbrockmendel Nov 2, 2020
d396ecc
REF: Categorical.is_dtype_equal -> categories_match_up_to_permutation…
jbrockmendel Nov 2, 2020
ed49ab3
CLN refactor non-core (#37580)
MarcoGorelli Nov 2, 2020
fdcd74b
refactor core/computation (#37585)
MarcoGorelli Nov 2, 2020
bc1868a
TST/REF: share method tests between DataFrame and Series (#37596)
jbrockmendel Nov 3, 2020
fe4e7f5
BUG: Index.where casting ints to str (#37591)
jbrockmendel Nov 3, 2020
b22f7ad
REF: IntervalArray comparisons (#37124)
jbrockmendel Nov 3, 2020
2f28e80
regression fix for merging DF with datetime index with empty DF (#36897)
PCerles Nov 3, 2020
743b1b1
ERR: fix error message in Period for invalid frequency (#37602)
jorisvandenbossche Nov 3, 2020
ddf2bee
CLN: remove rebox_native (#37608)
jbrockmendel Nov 3, 2020
18767f8
TST/REF: tests.generic (#37618)
jbrockmendel Nov 4, 2020
e17ce57
TST: collect tests by method (#37617)
jbrockmendel Nov 4, 2020
626eca7
TST/REF: share tests across Series/DataFrame (#37616)
jbrockmendel Nov 4, 2020
ef0314e
Gh 36562 typeerror comparison not supported between float and str (#3…
ssche Nov 4, 2020
d893c62
docs: fix punctuation (#37612)
MicaelJarniac Nov 4, 2020
95d3117
REGR: pd.to_hdf(..., dropna=True) not dropping missing rows (#37564)
arw2019 Nov 4, 2020
d270e0b
parametrize set_axis tests (#37619)
jbrockmendel Nov 4, 2020
4aadb07
CLN: clean color selection in _matplotlib/style (#37203)
ivanovmg Nov 4, 2020
6cbbd4f
DEPR: DataFrame/Series.slice_shift (#37601)
erfannariman Nov 4, 2020
6bfbb3f
REF: re-use validate_setitem_value in Categorical.fillna (#37597)
jbrockmendel Nov 4, 2020
4c855e1
PERF: release gil for ewma_time (#37389)
fangchenli Nov 4, 2020
b77ea70
BUG: Groupy dropped nan groups from result when grouping over single …
phofl Nov 4, 2020
042d22f
ENH: implement timeszones support for read_json(orient='table') and a…
attack68 Nov 4, 2020
0a1185f
REF/BUG/TYP: read_csv shouldn't close user-provided file handles (#36…
twoertwein Nov 4, 2020
edfbfe7
more typing checks to pre-commit (#37539)
MarcoGorelli Nov 4, 2020
3724b6b
TST: 32bit dtype compat test_groupby_dropna (#37623)
ivanovmg Nov 4, 2020
49aadaa
BUG: Metadata propagation for groupby iterator (#37461)
Japanuspus Nov 4, 2020
8d79d64
BUG: read-only values in cython funcs (#37613)
jbrockmendel Nov 4, 2020
8462c7e
CLN refactor core/arrays (#37581)
MarcoGorelli Nov 4, 2020
40af4a5
Fixed Metadata Propogation in DataFrame (#37381)
abbywh Nov 4, 2020
53147b4
TYP: add Shape alias to pandas._typing (#37128)
arw2019 Nov 4, 2020
48915e2
DOC: Fix typo (#37630)
MicaelJarniac Nov 4, 2020
07acef8
CLN: parametrize test_nat_comparisons (#37195)
ivanovmg Nov 4, 2020
1731197
dataframe dataclass docstring updated (#37632)
taytzehao Nov 4, 2020
101aa24
refactor core/groupby (#37583)
MarcoGorelli Nov 4, 2020
8507455
BUG: set index of DataFrame.apply(f) when f returns dict (#37544) (#3…
ma3da Nov 4, 2020
bc17319
BUG: to_dict should return a native datetime object for NumPy backed …
arw2019 Nov 4, 2020
4ddaf47
ENH: memory_map for compressed files (#37621)
twoertwein Nov 5, 2020
a29a416
DOC: add example & prose of slicing with labels when index has duplic…
junjunjunk Nov 5, 2020
d8ced32
DOC: Fix typo (#37636)
MicaelJarniac Nov 5, 2020
bcb0988
Transfer tests
Mikhaylov-yv Nov 5, 2020
8526438
Changed class names
Mikhaylov-yv Nov 5, 2020
44345e8
Removed unnecessary imports
Mikhaylov-yv Nov 5, 2020
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
Prev Previous commit
Next Next commit
CLN: remove rebox_native (#37608)
  • Loading branch information
jbrockmendel authored and Mikhaylov-yv committed Nov 5, 2020
commit ddf2beeacb843e3ee355831d2141dcc1d657b6d3
5 changes: 3 additions & 2 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ def _rebox_native(cls, value: int) -> Union[int, np.datetime64, np.timedelta64]:
"""
raise AbstractMethodError(cls)

def _unbox_scalar(self, value: DTScalarOrNaT, setitem: bool = False) -> int:
def _unbox_scalar(
self, value: DTScalarOrNaT, setitem: bool = False
) -> Union[np.int64, np.datetime64, np.timedelta64]:
"""
Unbox the integer value of a scalar `value`.

Expand Down Expand Up @@ -636,7 +638,6 @@ def _unbox(
"""
if lib.is_scalar(other):
other = self._unbox_scalar(other, setitem=setitem)
other = self._rebox_native(other)
else:
# same type as self
self._check_compatible_with(other, setitem=setitem)
Expand Down
9 changes: 3 additions & 6 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,16 +454,13 @@ def _generate_range(
# -----------------------------------------------------------------
# DatetimeLike Interface

@classmethod
def _rebox_native(cls, value: int) -> np.datetime64:
return np.int64(value).view("M8[ns]")

def _unbox_scalar(self, value, setitem: bool = False):
def _unbox_scalar(self, value, setitem: bool = False) -> np.datetime64:
if not isinstance(value, self._scalar_type) and value is not NaT:
raise ValueError("'value' should be a Timestamp.")
if not isna(value):
self._check_compatible_with(value, setitem=setitem)
return value.value
return value.asm8
return np.datetime64(value.value, "ns")

def _scalar_from_string(self, value):
return Timestamp(value, tz=self.tz)
Expand Down
8 changes: 2 additions & 6 deletions pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,14 @@ def _generate_range(cls, start, end, periods, freq, fields):
# -----------------------------------------------------------------
# DatetimeLike Interface

@classmethod
def _rebox_native(cls, value: int) -> np.int64:
return np.int64(value)

def _unbox_scalar(
self, value: Union[Period, NaTType], setitem: bool = False
) -> int:
if value is NaT:
return value.value
return np.int64(value.value)
elif isinstance(value, self._scalar_type):
self._check_compatible_with(value, setitem=setitem)
return value.ordinal
return np.int64(value.ordinal)
else:
raise ValueError(f"'value' should be a Period. Got '{value}' instead.")

Expand Down
8 changes: 2 additions & 6 deletions pandas/core/arrays/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,11 @@ def _generate_range(cls, start, end, periods, freq, closed=None):
# ----------------------------------------------------------------
# DatetimeLike Interface

@classmethod
def _rebox_native(cls, value: int) -> np.timedelta64:
return np.int64(value).view("m8[ns]")

def _unbox_scalar(self, value, setitem: bool = False):
def _unbox_scalar(self, value, setitem: bool = False) -> np.timedelta64:
if not isinstance(value, self._scalar_type) and value is not NaT:
raise ValueError("'value' should be a Timedelta.")
self._check_compatible_with(value, setitem=setitem)
return value.value
return np.timedelta64(value.value, "ns")

def _scalar_from_string(self, value):
return Timedelta(value)
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/arrays/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ def test_unbox_scalar(self):
data = np.arange(10, dtype="i8") * 24 * 3600 * 10 ** 9
arr = self.array_cls(data, freq="D")
result = arr._unbox_scalar(arr[0])
assert isinstance(result, int)
expected = arr._data.dtype.type
assert isinstance(result, expected)

result = arr._unbox_scalar(pd.NaT)
assert isinstance(result, int)
assert isinstance(result, expected)

msg = f"'value' should be a {self.dtype.__name__}."
with pytest.raises(ValueError, match=msg):
Expand Down