REF: Move pandas.core.categorical
State: closed

Prep for https://github.com/pandas-dev/pandas/pull/19268



Labels:
name: Refactor
description: Internal refactoring of code
name: Categorical
description: Categorical Data Type

Comments:
There sure are a lot of people importing `from pandas.core.categorical` :/ https://github.com/search?q=from+pandas.core.categorical+import&type=Code&utf8=%E2%9C%93

I think I'll add a small future warning saying to use the public API.

Edit: oh A good chunk of that is people just uploading their entire site-packages to github :/
you could add a deprecating module (e.g. like tslib.py) in the to-level to make a nice transition
This looks pretty benign to me (I'm assuming there weren't any clandestine changes in the cut/paste).

I'd argue for calling it `vectors` instead of `arrays` so as to a) draw a clear distinction between the responsibilities of these objects vs np.array vs pd2 WIP and b) emphasize "FooVector is a vectorized version of FooScalar" (admittedly a motivation more specific to the arith/comparisons I've been focused on)
you prob need to change the paths in api.rst as well
> I'd argue for calling it vectors instead of arrays so as to a) draw a clear distinction between the responsibilities of these objects vs np.array vs pd2 WIP and b) emphasize "FooVector is a vectorized version of FooScalar" (admittedly a motivation more specific to the arith/comparisons I've been focused on)

no this is naming scheme is well-established
api.rst is all good. All the references via the public API.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19269?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@4086e42`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `95.91%`.

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

```diff
@@            Coverage Diff            @@
##             master   #19269   +/-   ##
=========================================
  Coverage          ?    91.5%           
=========================================
  Files             ?      150           
  Lines             ?    48879           
  Branches          ?        0           
=========================================
  Hits              ?    44729           
  Misses            ?     4150           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.88% <95.91%> (?)` | |
| #single | `41.7% <39.52%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19269?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/compat/pickle\_compat.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9waWNrbGVfY29tcGF0LnB5) | `75.6% <ø> (ø)` | |
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `92.45% <100%> (ø)` | |
| [pandas/core/reshape/concat.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9jb25jYXQucHk=) | `97.58% <100%> (ø)` | |
| [pandas/core/reshape/reshape.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9yZXNoYXBlLnB5) | `100% <100%> (ø)` | |
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `96.22% <100%> (ø)` | |
| [pandas/core/arrays/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL19faW5pdF9fLnB5) | `100% <100%> (ø)` | |
| [pandas/core/sorting.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc29ydGluZy5weQ==) | `98.19% <100%> (ø)` | |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.61% <100%> (ø)` | |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.62% <100%> (ø)` | |
| [pandas/core/internals.py](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzLnB5) | `94.5% <100%> (ø)` | |
| ... and [8 more](https://codecov.io/gh/pandas-dev/pandas/pull/19269/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19269?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/19269?src=pr&el=footer). Last update [4086e42...70da106](https://codecov.io/gh/pandas-dev/pandas/pull/19269?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

not sure if you saw my comment above. I think you need a dummpy ``pandas.core.categorical.py`` which shows a FutureWarning.
Yeah I have one. The diff is strange. The warning is at the top, and the import is at the bottom. 
I c, ok. can you add a test for this (maybe in test_api), and add to the deprecations list. otherwise lgtm.
Added a test.
Are we cool with merging PRs before the Mac build finishes? Travis had another outage, so they're backlogged again.
I think I'm going to merge PRs that are unlikely to have issues specific to the Mac build. https://travis-ci.org/pandas-dev/pandas/builds/330306709 started 2.5 hours ago, and the Mac build hasn't been scheduled yet.

I'll do cleanup if I *do* break anything :)