Cleanup & De-duplication for custom offset classes
State: closed

The diff looks a little bit mangled.  This PR does two things.

1) Centralize frequently-repeated calendar `__init__` in a new _CustomMixin

2) Merge a bunch of shared CustomBusinessMonthEnd and CustomBusinessMonthBegin logic into a parent class.

- [ ] closes #xxxx
- [ ] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Timedelta
description: Timedelta data type
name: Clean

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

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

```diff
@@            Coverage Diff             @@
##           master   #18640      +/-   ##
==========================================
- Coverage   91.59%   91.58%   -0.02%     
==========================================
  Files         155      153       -2     
  Lines       51255    51234      -21     
==========================================
- Hits        46948    46922      -26     
- Misses       4307     4312       +5
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.44% <100%> (ø)` | :arrow_up: |
| #single | `40.66% <65.78%> (-0.12%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18640?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/18640/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `96.86% <100%> (-0.04%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18640/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18640/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/18640/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `95.64% <0%> (-0.02%)` | :arrow_down: |
| [pandas/io/wb.py](https://codecov.io/gh/pandas-dev/pandas/pull/18640/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3diLnB5) | | |
| [pandas/io/data.py](https://codecov.io/gh/pandas-dev/pandas/pull/18640/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2RhdGEucHk=) | | |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/18640/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `82.01% <0%> (+0.19%)` | :arrow_up: |

------

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

thanks @jbrockmendel 

pls document anything you can (you are already doing this), but more is better than less. yes doc-strings are boring :<, but this helps improve things even more.
> pls document anything you can (you are already doing this), but more is better than less. yes doc-strings are boring :<, but this helps improve things even more.

Will do.  Current gameplan vis-a-vis offsets:
  - fix confusing (several GH issues) [naming scheme](https://github.com/pandas-dev/pandas/issues/18235#issuecomment-346220122) in Quarter offsets, pending getting the "go-ahead"
  - hope/ask [for help](https://github.com/pandas-dev/pandas/pull/18224#issuecomment-348055959) with the cython-immutability goal, since that will entail a _major_ perf win.
  - update/fix docs on "anchored", implement a few missing non-anchored (Year, Quarter, Month, Day) offsets
  - distinguish between offsets that are Period-friendly vs just-for-date_range (there are a bunch of GH issues that boil down to confusion on this point)
- fix issues with Tick comparison methods (1+ GH issues)