Skip to content

Commit

Permalink
review updates 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jschendel committed Oct 2, 2017
1 parent 3d58a51 commit 4cbf70d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
16 changes: 8 additions & 8 deletions doc/source/timeseries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ of those specified will not be generated:
Custom Frequency Ranges
~~~~~~~~~~~~~~~~~~~~~~~

.. warning::

This functionality was originally exclusive to ``cdate_range``, which is
deprecated as of version 0.21.0 in favor of ``bdate_range``. Note that
``cdate_range`` only utilizes the ``weekmask`` and ``holidays`` parameters
when custom business day, 'C', is passed as the frequency string. Support has
been expanded with ``bdate_range`` to work with any custom frequency string.

.. versionadded:: 0.21.0

``bdate_range`` can also generate a range of custom frequency dates by using
Expand All @@ -415,14 +423,6 @@ used if a custom frequency string is passed.
pd.bdate_range(start, end, freq='CBMS', weekmask=weekmask)
.. warning::

This functionality was originally exclusive to ``cdate_range``, which is
deprecated as of version 0.21.0 in favor of ``bdate_range``. Note that
``cdate_range`` only utilizes the ``weekmask`` and ``holidays`` parameters
when custom business day, 'C', is passed as the frequency string. Support has
been expanded with ``bdate_range`` to work with any custom frequency string.

.. seealso::

:ref:`timeseries.custombusinessdays`
Expand Down
10 changes: 10 additions & 0 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,13 @@ def test_deprecation_access_func(self):
[c1, c2],
sort_categories=True,
ignore_order=True)


class TestCDateRange(object):

def test_deprecation_cdaterange(self):
# GH17596
from pandas.core.indexes.datetimes import cdate_range
with tm.assert_produces_warning(FutureWarning,
check_stacklevel=False):
cdate_range('2017-01-01', '2017-12-31')
6 changes: 0 additions & 6 deletions pandas/tests/indexes/datetimes/test_date_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import pandas as pd
import pandas.util.testing as tm
from pandas import compat
from pandas.core.indexes.datetimes import cdate_range
from pandas import date_range, bdate_range, offsets, DatetimeIndex, Timestamp
from pandas.tseries.offsets import (generate_range, CDay, BDay, DateOffset,
MonthEnd, prefix_mapping)
Expand Down Expand Up @@ -634,8 +633,3 @@ def test_all_custom_freq(self, freq):
msg = 'invalid custom frequency string: {freq}'
with tm.assert_raises_regex(ValueError, msg.format(freq=bad_freq)):
bdate_range(START, END, freq=bad_freq)

def test_deprecation_cdaterange(self):
# GH17596
with tm.assert_produces_warning(FutureWarning):
cdate_range(START, END)

0 comments on commit 4cbf70d

Please sign in to comment.