implement independent parts of #24024
State: closed

@TomAugspurger just for kicks I went through to see how much of #24024 could be implemented without actually changing anything.  Could've squeezed out a little bit more; as-is only about 6% by line-count.  If it's not worth the rebasing hassle, I'll close.

Labels:
name: Datetime
description: Datetime data dtype
name: Clean

Comments:
Hello @jbrockmendel! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/arrays/datetimelike.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/arrays/datetimelike.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/datetimes.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/arrays/datetimes.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/period.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/arrays/period.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/timedeltas.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/arrays/timedeltas.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/datetimes.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/indexes/datetimes.py) !

 - There are no PEP8 issues in the file [`pandas/io/formats/format.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/io/formats/format.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/datetimes/test_astype.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/indexes/datetimes/test_astype.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/period/test_astype.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/indexes/period/test_astype.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/timedeltas/test_astype.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/indexes/timedeltas/test_astype.py) !

 - There are no PEP8 issues in the file [`pandas/tests/io/json/test_pandas.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/io/json/test_pandas.py) !

 - There are no PEP8 issues in the file [`pandas/tests/series/test_datetime_values.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/series/test_datetime_values.py) !

 - There are no PEP8 issues in the file [`pandas/tests/series/test_timeseries.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/series/test_timeseries.py) !

 - There are no PEP8 issues in the file [`pandas/tests/test_base.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/test_base.py) !

 - There are no PEP8 issues in the file [`pandas/util/testing.py`](https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/util/testing.py) !


Looks good. I restarted the CI services.

Do you know if the monotonic changes on the array classes are actually hit
by tests on this PR? Not a big deal,
either way.

On Thu, Dec 13, 2018 at 10:15 PM PEP8 Speaks <notifications@github.com>
wrote:

> Hello @jbrockmendel <https://github.com/jbrockmendel>! Thanks for
> submitting the PR.
>
>    -
>
>    There are no PEP8 issues in the file pandas/core/arrays/datetimelike.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/arrays/datetimelike.py>
>    !
>    -
>
>    There are no PEP8 issues in the file pandas/core/arrays/datetimes.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/arrays/datetimes.py>
>    !
>    -
>
>    There are no PEP8 issues in the file pandas/core/arrays/period.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/arrays/period.py>
>    !
>    -
>
>    There are no PEP8 issues in the file pandas/core/arrays/timedeltas.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/arrays/timedeltas.py>
>    !
>    -
>
>    There are no PEP8 issues in the file pandas/core/indexes/datetimes.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/core/indexes/datetimes.py>
>    !
>    -
>
>    There are no PEP8 issues in the file pandas/io/formats/format.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/io/formats/format.py>
>    !
>    -
>
>    There are no PEP8 issues in the file
>    pandas/tests/indexes/datetimes/test_astype.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/indexes/datetimes/test_astype.py>
>    !
>    -
>
>    There are no PEP8 issues in the file
>    pandas/tests/indexes/period/test_astype.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/indexes/period/test_astype.py>
>    !
>    -
>
>    There are no PEP8 issues in the file
>    pandas/tests/indexes/timedeltas/test_astype.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/indexes/timedeltas/test_astype.py>
>    !
>    -
>
>    There are no PEP8 issues in the file
>    pandas/tests/io/json/test_pandas.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/io/json/test_pandas.py>
>    !
>    -
>
>    There are no PEP8 issues in the file
>    pandas/tests/series/test_datetime_values.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/series/test_datetime_values.py>
>    !
>    -
>
>    There are no PEP8 issues in the file
>    pandas/tests/series/test_timeseries.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/series/test_timeseries.py>
>    !
>    -
>
>    There are no PEP8 issues in the file pandas/tests/test_base.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/tests/test_base.py>
>    !
>    -
>
>    There are no PEP8 issues in the file pandas/util/testing.py
>    <https://github.com/jbrockmendel/pandas/blob/bb71995dbbe3d538cf94bcee0fc023f56a5def0c/pandas/util/testing.py>
>    !
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/24276#issuecomment-447207942>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIilV9_jagzsJdvV295wOraGCjdsGks5u4yXTgaJpZM4ZS26J>
> .
>

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=h1) Report
> Merging [#24276](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/d43ac979fdf3038c713de93c7b27b4140be6c9c5?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24276/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24276      +/-   ##
==========================================
+ Coverage   92.22%   92.22%   +<.01%     
==========================================
  Files         162      162              
  Lines       51789    51797       +8     
==========================================
+ Hits        47762    47771       +9     
+ Misses       4027     4026       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.63% <100%> (ø)` | :arrow_up: |
| #single | `43.01% <58.53%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `96.38% <100%> (+0.03%)` | :arrow_up: |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `97.98% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3RpbWVkZWx0YXMucHk=) | `87.16% <100%> (+0.05%)` | :arrow_up: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `96.33% <100%> (-0.02%)` | :arrow_down: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `98.57% <100%> (+0.01%)` | :arrow_up: |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `98.5% <100%> (+0.21%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.51% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=footer). Last update [d43ac97...bb71995](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=h1) Report
> Merging [#24276](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/d43ac979fdf3038c713de93c7b27b4140be6c9c5?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24276/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24276      +/-   ##
==========================================
+ Coverage   92.22%   92.22%   +<.01%     
==========================================
  Files         162      162              
  Lines       51789    51797       +8     
==========================================
+ Hits        47762    47771       +9     
+ Misses       4027     4026       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.63% <100%> (ø)` | :arrow_up: |
| #single | `43.01% <58.53%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `96.38% <100%> (+0.03%)` | :arrow_up: |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `97.98% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3RpbWVkZWx0YXMucHk=) | `87.16% <100%> (+0.05%)` | :arrow_up: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `96.33% <100%> (-0.02%)` | :arrow_down: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `98.57% <100%> (+0.01%)` | :arrow_up: |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `98.5% <100%> (+0.21%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24276/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.51% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=footer). Last update [d43ac97...bb71995](https://codecov.io/gh/pandas-dev/pandas/pull/24276?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

lgtm. @TomAugspurger merge if ok (as you will have to rebase on top)