Skip to content

BUG: Increase range of dates for holiday calculations #27790

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

Merged
merged 16 commits into from
Oct 24, 2019
Merged

BUG: Increase range of dates for holiday calculations #27790

merged 16 commits into from
Oct 24, 2019

Conversation

rhstanton
Copy link
Contributor

@rhstanton rhstanton commented Aug 6, 2019

@gfyoung gfyoung added Bug Datetime Datetime data dtype labels Aug 6, 2019
@rhstanton
Copy link
Contributor Author

rhstanton commented Aug 6, 2019 via email

@rhstanton
Copy link
Contributor Author

rhstanton commented Aug 6, 2019 via email

@jbrockmendel
Copy link
Member

Was there any performance impact?

@jbrockmendel
Copy link
Member

Are there holidays that were instituted between 1900 and 1970 that will incorrectly be retroactively celebrated?

@rhstanton
Copy link
Contributor Author

rhstanton commented Aug 6, 2019 via email

@rhstanton
Copy link
Contributor Author

rhstanton commented Aug 6, 2019 via email

@rhstanton
Copy link
Contributor Author

rhstanton commented Aug 7, 2019 via email

@rhstanton
Copy link
Contributor Author

rhstanton commented Aug 7, 2019 via email

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Aug 7, 2019 via email

@rhstanton
Copy link
Contributor Author

rhstanton commented Aug 7, 2019 via email

@jbrockmendel
Copy link
Member

git push --set-upstream origin holiday_update

is what I do every time I push a new branch. The thing I'm confused about is how you pushed the first time?

@rhstanton
Copy link
Contributor Author

rhstanton commented Aug 7, 2019 via email

@jreback
Copy link
Contributor

jreback commented Sep 8, 2019

can you merge master, also I think we would want a test for this.

@rhstanton
Copy link
Contributor Author

can you merge master, also I think we would want a test for this.

Is that something I can do, or does someone with greater permissions need to do this?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Sep 19, 2019 via email

@pep8speaks
Copy link

pep8speaks commented Sep 24, 2019

Hello @rhstanton! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-10-18 17:17:22 UTC

@rhstanton
Copy link
Contributor Author

I've added a test and pushed back to github, but I'm not sure how to merge my new code into master...

@rhstanton
Copy link
Contributor Author

Github tells me "This branch has no conflicts with the base branch. Only those with write access to this repository can merge pull requests." How do I get write access?

@gfyoung
Copy link
Member

gfyoung commented Sep 24, 2019

How do I get write access?

Write access is restricted to maintainers.

In order for us to merge your PR, we do need all tests to pass first!

@rhstanton
Copy link
Contributor Author

In order for us to merge your PR, we do need all tests to pass first!

It’s true that two tests failed, but they had nothing to do with my edits!

@gfyoung
Copy link
Member

gfyoung commented Sep 25, 2019

It’s true that two tests failed, but they had nothing to do with my edits!

That is true, but as a rule, we do want to merge with all tests passing. In this case, to "fix" the issue, you should rebase or merge master to pull in the fixes.

workDay = offsets.CustomBusinessDay(calendar=cal)
Sat_before_Labor_Day_2031 = to_datetime('2031-08-30')
next_working_day = Sat_before_Labor_Day_2031 + 0 * workDay
assert(next_working_day == to_datetime('2031-09-02'))
Copy link
Member

@gfyoung gfyoung Sep 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And while you're at it: can you remove the parentheses here?

We use bare assert statements (see the test above).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. I'll wait until tomorrow, though. Merging master had no effect just now, so it seems the errors are in the current version.

Copy link
Contributor Author

@rhstanton rhstanton Sep 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After pushing , the checks now give me an error message like this:

##[error]Bash exited with code '1'.

But I have no idea what to do about fixing this.

Copy link
Member

@gfyoung gfyoung Sep 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=17967

It looks like the black pandas lint check is failing (https://pypi.org/project/black/).

You are so close!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reformatted that file using black. Let's see if it works now. I'm hoping it's a bit quicker next time...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It passed all tests!

@WillAyd
Copy link
Member

WillAyd commented Oct 10, 2019

Can you add a whatsnew? Does this have any performance impacts as questioned by @jbrockmendel ?

@rhstanton
Copy link
Contributor Author

Added an entry to whatsnew. No obvious performance impact in my uses. What still needs doing?

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbrockmendel are there any ASVs applicable here?

@@ -40,6 +40,9 @@ Other
- Compatibility with Python 3.8 in :meth:`DataFrame.query` (:issue:`27261`)
- Fix to ensure that tab-completion in an IPython console does not raise
warnings for deprecated attributes (:issue:`27900`).
- Fix :class:`AbstractHolidayCalendar` to return correct results for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this to v1.0.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhstanton as a last check can you run the ASV benchmarks in asv/benchmarks/offset.py and post results here? If no regressions I think good to merge

@jreback jreback added this to the 1.0 milestone Oct 22, 2019
@jreback
Copy link
Contributor

jreback commented Oct 22, 2019

lgtm.

@rhstanton
Copy link
Contributor Author

No output:

(pandas_dev) Richards-Mac-Pro:benchmarks stanton$ python offset.py
(pandas_dev) Richards-Mac-Pro:benchmarks stanton$

@jreback
Copy link
Contributor

jreback commented Oct 23, 2019

No output:

(pandas_dev) Richards-Mac-Pro:benchmarks stanton$ python offset.py
(pandas_dev) Richards-Mac-Pro:benchmarks stanton$

you need to actually run the asv benchmarks: https://dev.pandas.io/docs/development/contributing.html#running-the-performance-test-suite

@rhstanton
Copy link
Contributor Author

Now I know... Not sure how much of this matters, so here's the entire output:

(pandas_dev) Richards-Mac-Pro:asv_bench stanton$ asv continuous -f 1.1 upstream/master holiday_update -b ^offset
· Creating environments
· Discovering benchmarks.
·· Uninstalling from conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt.
·· Installing d53eb28 <holiday_update> into conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt...
· Running 20 total benchmarks (2 commits * 1 environments * 10 benchmarks)
[ 0.00%] · For pandas commit 709436d <holiday_update^2> (round 1/2):
[ 0.00%] ·· Building for conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt...
[ 0.00%] ·· Benchmarking conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[ 2.50%] ··· Running (offset.ApplyIndex.time_apply_index--)..
[ 7.50%] ··· Running (offset.OffestDatetimeArithmetic.time_add_10--).
[ 10.00%] ··· Running (offset.OffestDatetimeArithmetic.time_apply--).
[ 12.50%] ··· Running (offset.OffestDatetimeArithmetic.time_apply_np_dt64--).
[ 15.00%] ··· Running (offset.OffestDatetimeArithmetic.time_subtract--).
[ 17.50%] ··· Running (offset.OffestDatetimeArithmetic.time_subtract_10--)..
[ 22.50%] ··· Running (offset.OffsetSeriesArithmetic.time_add_offset--).
[ 25.00%] ··· Running (offset.OnOffset.time_on_offset--).
[ 25.00%] · For pandas commit d53eb28 <holiday_update> (round 1/2):
[ 25.00%] ·· Building for conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt...
[ 25.00%] ·· Benchmarking conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[ 27.50%] ··· Running (offset.ApplyIndex.time_apply_index--)..
[ 32.50%] ··· Running (offset.OffestDatetimeArithmetic.time_add_10--).
[ 35.00%] ··· Running (offset.OffestDatetimeArithmetic.time_apply--).
[ 37.50%] ··· Running (offset.OffestDatetimeArithmetic.time_apply_np_dt64--).
[ 40.00%] ··· Running (offset.OffestDatetimeArithmetic.time_subtract--).
[ 42.50%] ··· Running (offset.OffestDatetimeArithmetic.time_subtract_10--).
[ 45.00%] ··· Running (offset.OffsetDatetimeIndexArithmetic.time_add_offset--).
[ 47.50%] ··· Running (offset.OffsetSeriesArithmetic.time_add_offset--).
[ 50.00%] ··· Running (offset.OnOffset.time_on_offset--).
[ 50.00%] · For pandas commit d53eb28 <holiday_update> (round 2/2):
[ 50.00%] ·· Benchmarking conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[ 52.50%] ··· offset.ApplyIndex.time_apply_index ok
[ 52.50%] ··· =================================== =============
offset
----------------------------------- -------------
<YearEnd: month=12> 979±5μs
<YearBegin: month=1> 741±6μs
<QuarterEnd: startingMonth=3> 902±5μs
<QuarterBegin: startingMonth=3> 803±4μs
910±3μs
732±3μs
<DateOffset: days=2, months=2> 1.85±0.02ms
7.41±0.05ms
<SemiMonthEnd: day_of_month=15> 9.21±0.07ms
<SemiMonthBegin: day_of_month=15> 8.30±0.02ms
=================================== =============

[ 55.00%] ··· offset.OffestDatetimeArithmetic.time_add ok
[ 55.00%] ··· ========================================= =============
offset
----------------------------------------- -------------
72.6±0.8μs
<BusinessYearEnd: month=12> 36.1±0.2μs
<BusinessYearBegin: month=1> 36.3±0.3μs
<BusinessQuarterEnd: startingMonth=3> 36.6±0.3μs
<BusinessQuarterBegin: startingMonth=3> 36.4±0.2μs
36.0±0.3μs
35.2±0.2μs
(0) 62.3±0.07μs
(1) 62.1±0.09μs
322±7μs
(0) 215±0.8μs
(1) 212±1μs
<YearEnd: month=12> 36.1±1μs
<YearBegin: month=1> 35.4±0.4μs
<QuarterEnd: startingMonth=3> 36.8±0.5μs
<QuarterBegin: startingMonth=3> 36.3±0.1μs
35.6±0.3μs
35.7±0.6μs
<DateOffset: days=2, months=2> 37.1±0.4μs
38.0±0.4μs
<SemiMonthEnd: day_of_month=15> 38.2±0.8μs
<SemiMonthBegin: day_of_month=15> 37.9±0.5μs
========================================= =============

[ 57.50%] ··· offset.OffestDatetimeArithmetic.time_add_10 ok
[ 57.50%] ··· ========================================= ============
offset
----------------------------------------- ------------
82.0±1μs
<BusinessYearEnd: month=12> 45.2±0.3μs
<BusinessYearBegin: month=1> 47.1±0.3μs
<BusinessQuarterEnd: startingMonth=3> 46.9±0.6μs
<BusinessQuarterBegin: startingMonth=3> 46.3±0.5μs
43.9±0.5μs
43.1±0.2μs
(0) 85.5±0.6μs
(1) 75.2±0.2μs
355±2μs
(0) 251±2μs
(1) 245±2μs
<YearEnd: month=12> 44.5±0.2μs
<YearBegin: month=1> 45.3±0.3μs
<QuarterEnd: startingMonth=3> 45.0±0.8μs
<QuarterBegin: startingMonth=3> 45.4±0.1μs
43.5±0.1μs
42.6±0.3μs
<DateOffset: days=2, months=2> 154±0.3μs
47.0±0.2μs
<SemiMonthEnd: day_of_month=15> 48.6±0.6μs
<SemiMonthBegin: day_of_month=15> 48.8±0.2μs
========================================= ============

[ 60.00%] ··· offset.OffestDatetimeArithmetic.time_apply ok
[ 60.00%] ··· ========================================= ============
offset
----------------------------------------- ------------
69.7±2μs
<BusinessYearEnd: month=12> 32.9±0.2μs
<BusinessYearBegin: month=1> 33.3±0.2μs
<BusinessQuarterEnd: startingMonth=3> 35.0±0.5μs
<BusinessQuarterBegin: startingMonth=3> 33.5±0.2μs
31.9±0.5μs
32.7±0.7μs
(0) 59.0±1μs
(1) 58.8±0.3μs
322±2μs
(0) 215±3μs
(1) 213±2μs
<YearEnd: month=12> 32.8±0.2μs
<YearBegin: month=1> 33.4±0.4μs
<QuarterEnd: startingMonth=3> 33.8±0.9μs
<QuarterBegin: startingMonth=3> 34.2±0.5μs
32.3±0.2μs
32.5±0.5μs
<DateOffset: days=2, months=2> 34.8±0.4μs
35.2±0.3μs
<SemiMonthEnd: day_of_month=15> 36.3±2μs
<SemiMonthBegin: day_of_month=15> 36.8±0.1μs
========================================= ============

[ 62.50%] ··· offset.OffestDatetimeArithmetic.time_apply_np_dt64 ok
[ 62.50%] ··· ========================================= =============
offset
----------------------------------------- -------------
71.0±1μs
<BusinessYearEnd: month=12> 33.1±0.5μs
<BusinessYearBegin: month=1> 33.4±0.3μs
<BusinessQuarterEnd: startingMonth=3> 34.3±0.6μs
<BusinessQuarterBegin: startingMonth=3> 34.0±0.1μs
34.7±0.4μs
33.2±0.2μs
(0) 59.9±0.3μs
(1) 59.9±0.4μs
324±3μs
(0) 215±0.3μs
(1) 213±5μs
<YearEnd: month=12> 33.1±0.3μs
<YearBegin: month=1> 33.5±0.6μs
<QuarterEnd: startingMonth=3> 35.0±1μs
<QuarterBegin: startingMonth=3> 34.3±0.1μs
33.1±0.6μs
33.4±0.3μs
<DateOffset: days=2, months=2> 37.0±0.6μs
36.1±0.3μs
<SemiMonthEnd: day_of_month=15> 35.9±0.1μs
<SemiMonthBegin: day_of_month=15> 36.7±0.04μs
========================================= =============

[ 65.00%] ··· offset.OffestDatetimeArithmetic.time_subtract ok
[ 65.00%] ··· ========================================= =============
offset
----------------------------------------- -------------
83.7±1μs
<BusinessYearEnd: month=12> 47.0±0.3μs
<BusinessYearBegin: month=1> 45.8±0.5μs
<BusinessQuarterEnd: startingMonth=3> 47.9±0.4μs
<BusinessQuarterBegin: startingMonth=3> 47.4±0.4μs
45.5±1μs
44.6±0.2μs
(0) 88.1±1μs
(1) 77.2±1μs
287±7μs
(0) 331±6μs
(1) 339±2μs
<YearEnd: month=12> 47.5±0.5μs
<YearBegin: month=1> 46.3±0.2μs
<QuarterEnd: startingMonth=3> 47.7±0.2μs
<QuarterBegin: startingMonth=3> 47.7±0.5μs
43.9±0.07μs
44.8±0.2μs
<DateOffset: days=2, months=2> 82.4±0.4μs
49.2±0.7μs
<SemiMonthEnd: day_of_month=15> 49.5±0.4μs
<SemiMonthBegin: day_of_month=15> 50.1±0.3μs
========================================= =============

[ 67.50%] ··· offset.OffestDatetimeArithmetic.time_subtract_10 ok
[ 67.50%] ··· ========================================= ============
offset
----------------------------------------- ------------
88.4±0.1μs
<BusinessYearEnd: month=12> 51.9±0.7μs
<BusinessYearBegin: month=1> 53.4±1μs
<BusinessQuarterEnd: startingMonth=3> 52.6±0.3μs
<BusinessQuarterBegin: startingMonth=3> 51.1±0.3μs
47.3±0.3μs
48.1±0.5μs
(0) 97.9±1μs
(1) 88.0±0.5μs
289±0.2μs
(0) 258±0.4μs
(1) 259±2μs
<YearEnd: month=12> 51.2±0.1μs
<YearBegin: month=1> 50.8±0.5μs
<QuarterEnd: startingMonth=3> 52.1±0.2μs
<QuarterBegin: startingMonth=3> 53.0±0.7μs
47.5±0.3μs
46.1±0.1μs
<DateOffset: days=2, months=2> 296±0.6μs
54.6±0.3μs
<SemiMonthEnd: day_of_month=15> 55.3±0.3μs
<SemiMonthBegin: day_of_month=15> 54.9±0.2μs
========================================= ============

[ 70.00%] ··· offset.OffsetDatetimeIndexArithmetic.time_add_offset ok
[ 70.00%] ··· ========================================= =============
offset
----------------------------------------- -------------
721±1μs
<BusinessYearEnd: month=12> 403±4μs
<BusinessYearBegin: month=1> 373±3μs
<BusinessQuarterEnd: startingMonth=3> 396±8μs
<BusinessQuarterBegin: startingMonth=3> 370±4μs
389±3μs
368±7μs
(0) 68.6±0.3ms
(1) 70.0±0.6ms
333±3ms
(0) 221±2ms
(1) 220±0.3ms
<YearEnd: month=12> 362±4μs
<YearBegin: month=1> 339±2μs
<QuarterEnd: startingMonth=3> 352±2μs
<QuarterBegin: startingMonth=3> 350±8μs
359±7μs
346±3μs
<DateOffset: days=2, months=2> 962±9μs
3.19±0.02ms
<SemiMonthEnd: day_of_month=15> 4.10±0.06ms
<SemiMonthBegin: day_of_month=15> 3.65±0.04ms
========================================= =============

[ 72.50%] ··· offset.OffsetSeriesArithmetic.time_add_offset ok
[ 72.50%] ··· ========================================= =============
offset
----------------------------------------- -------------
686±3μs
<BusinessYearEnd: month=12> 692±4μs
<BusinessYearBegin: month=1> 658±5μs
<BusinessQuarterEnd: startingMonth=3> 702±4μs
<BusinessQuarterBegin: startingMonth=3> 652±20μs
675±7μs
648±4μs
(0) 66.2±2ms
(1) 67.8±1ms
331±3ms
(0) 219±2ms
(1) 217±1ms
<YearEnd: month=12> 647±5μs
<YearBegin: month=1> 615±5μs
<QuarterEnd: startingMonth=3> 651±5μs
<QuarterBegin: startingMonth=3> 646±7μs
634±4μs
624±4μs
<DateOffset: days=2, months=2> 917±7μs
3.14±0.02ms
<SemiMonthEnd: day_of_month=15> 4.04±0.01ms
<SemiMonthBegin: day_of_month=15> 3.61±0.01ms
========================================= =============

[ 75.00%] ··· offset.OnOffset.time_on_offset ok
[ 75.00%] ··· ========================================= =============
offset
----------------------------------------- -------------
9.90±0.4μs
<BusinessYearEnd: month=12> 18.4±0.1μs
<BusinessYearBegin: month=1> 6.26±0.05μs
<BusinessQuarterEnd: startingMonth=3> 9.93±0.08μs
<BusinessQuarterBegin: startingMonth=3> 10.1±0.4μs
12.6±0.3μs
12.9±0.07μs
(0) 599±9μs
(1) 615±5μs
11.0±0.2ms
(0) 10.4±0.3ms
(1) 10.4±0.1ms
<YearEnd: month=12> 17.9±0.2μs
<YearBegin: month=1> 6.20±0.1μs
<QuarterEnd: startingMonth=3> 10.2±0.2μs
<QuarterBegin: startingMonth=3> 9.21±0.07μs
12.9±2μs
10.7±0.6μs
<DateOffset: days=2, months=2> 6.48±0.1μs
6.26±0.05μs
<SemiMonthEnd: day_of_month=15> 12.8±0.3μs
<SemiMonthBegin: day_of_month=15> 7.68±0.1μs
========================================= =============

[ 75.00%] · For pandas commit 709436d <holiday_update^2> (round 2/2):
[ 75.00%] ·· Building for conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt...
[ 75.00%] ·· Benchmarking conda-py3.6-Cython-matplotlib-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[ 77.50%] ··· offset.ApplyIndex.time_apply_index ok
[ 77.50%] ··· =================================== =============
offset
----------------------------------- -------------
<YearEnd: month=12> 960±10μs
<YearBegin: month=1> 768±1μs
<QuarterEnd: startingMonth=3> 902±8μs
<QuarterBegin: startingMonth=3> 815±5μs
911±3μs
739±9μs
<DateOffset: days=2, months=2> 1.87±0.03ms
7.52±0.1ms
<SemiMonthEnd: day_of_month=15> 9.34±0.1ms
<SemiMonthBegin: day_of_month=15> 8.47±0.1ms
=================================== =============

[ 80.00%] ··· offset.OffestDatetimeArithmetic.time_add ok
[ 80.00%] ··· ========================================= ============
offset
----------------------------------------- ------------
72.0±2μs
<BusinessYearEnd: month=12> 35.9±0.2μs
<BusinessYearBegin: month=1> 36.5±0.5μs
<BusinessQuarterEnd: startingMonth=3> 36.9±1μs
<BusinessQuarterBegin: startingMonth=3> 37.5±0.8μs
35.2±0.4μs
35.6±0.5μs
(0) 62.3±0.7μs
(1) 62.0±1μs
322±7μs
(0) 212±0.9μs
(1) 215±0.6μs
<YearEnd: month=12> 35.4±0.9μs
<YearBegin: month=1> 34.9±0.3μs
<QuarterEnd: startingMonth=3> 37.1±0.3μs
<QuarterBegin: startingMonth=3> 36.9±0.4μs
35.0±0.2μs
34.6±0.4μs
<DateOffset: days=2, months=2> 38.1±1μs
38.4±0.3μs
<SemiMonthEnd: day_of_month=15> 38.3±0.4μs
<SemiMonthBegin: day_of_month=15> 38.7±0.1μs
========================================= ============

[ 82.50%] ··· offset.OffestDatetimeArithmetic.time_add_10 ok
[ 82.50%] ··· ========================================= ============
offset
----------------------------------------- ------------
81.5±1μs
<BusinessYearEnd: month=12> 45.2±0.4μs
<BusinessYearBegin: month=1> 46.2±0.1μs
<BusinessQuarterEnd: startingMonth=3> 46.2±0.5μs
<BusinessQuarterBegin: startingMonth=3> 45.8±0.5μs
42.8±0.2μs
45.0±0.6μs
(0) 86.1±1μs
(1) 77.6±0.2μs
359±2μs
(0) 244±4μs
(1) 250±2μs
<YearEnd: month=12> 46.5±0.5μs
<YearBegin: month=1> 46.4±0.4μs
<QuarterEnd: startingMonth=3> 47.4±0.7μs
<QuarterBegin: startingMonth=3> 47.8±0.5μs
44.1±0.8μs
42.9±1μs
<DateOffset: days=2, months=2> 156±2μs
47.7±1μs
<SemiMonthEnd: day_of_month=15> 51.2±2μs
<SemiMonthBegin: day_of_month=15> 49.2±0.7μs
========================================= ============

[ 85.00%] ··· offset.OffestDatetimeArithmetic.time_apply ok
[ 85.00%] ··· ========================================= =============
offset
----------------------------------------- -------------
70.7±2μs
<BusinessYearEnd: month=12> 32.6±0.1μs
<BusinessYearBegin: month=1> 33.0±1μs
<BusinessQuarterEnd: startingMonth=3> 34.0±0.5μs
<BusinessQuarterBegin: startingMonth=3> 33.3±1μs
32.7±0.6μs
33.5±0.9μs
(0) 60.4±0.8μs
(1) 59.2±2μs
324±4μs
(0) 213±2μs
(1) 216±5μs
<YearEnd: month=12> 31.9±0.2μs
<YearBegin: month=1> 31.3±0.07μs
<QuarterEnd: startingMonth=3> 33.0±0.4μs
<QuarterBegin: startingMonth=3> 33.5±0.2μs
32.7±0.5μs
32.2±0.2μs
<DateOffset: days=2, months=2> 35.0±0.4μs
34.1±0.2μs
<SemiMonthEnd: day_of_month=15> 34.7±0.1μs
<SemiMonthBegin: day_of_month=15> 35.3±0.5μs
========================================= =============

[ 87.50%] ··· offset.OffestDatetimeArithmetic.time_apply_np_dt64 ok
[ 87.50%] ··· ========================================= =============
offset
----------------------------------------- -------------
70.9±0.5μs
<BusinessYearEnd: month=12> 32.5±0.3μs
<BusinessYearBegin: month=1> 33.5±0.5μs
<BusinessQuarterEnd: startingMonth=3> 34.4±1μs
<BusinessQuarterBegin: startingMonth=3> 34.0±0.6μs
33.9±0.5μs
32.8±0.09μs
(0) 58.7±0.1μs
(1) 59.6±0.7μs
321±1μs
(0) 220±4μs
(1) 212±2μs
<YearEnd: month=12> 33.1±0.05μs
<YearBegin: month=1> 33.5±0.9μs
<QuarterEnd: startingMonth=3> 34.8±0.4μs
<QuarterBegin: startingMonth=3> 34.0±0.3μs
33.0±0.6μs
33.8±0.3μs
<DateOffset: days=2, months=2> 35.3±0.2μs
35.5±0.9μs
<SemiMonthEnd: day_of_month=15> 35.2±0.4μs
<SemiMonthBegin: day_of_month=15> 36.0±0.3μs
========================================= =============

[ 90.00%] ··· offset.OffestDatetimeArithmetic.time_subtract ok
[ 90.00%] ··· ========================================= ============
offset
----------------------------------------- ------------
84.5±0.9μs
<BusinessYearEnd: month=12> 46.4±0.7μs
<BusinessYearBegin: month=1> 46.3±0.2μs
<BusinessQuarterEnd: startingMonth=3> 47.2±0.1μs
<BusinessQuarterBegin: startingMonth=3> 47.2±0.1μs
45.4±0.3μs
43.7±0.1μs
(0) 84.5±1μs
(1) 79.9±2μs
285±2μs
(0) 333±10μs
(1) 339±6μs
<YearEnd: month=12> 47.4±0.8μs
<YearBegin: month=1> 46.8±0.3μs
<QuarterEnd: startingMonth=3> 47.9±0.6μs
<QuarterBegin: startingMonth=3> 47.2±0.3μs
43.9±0.4μs
42.8±0.5μs
<DateOffset: days=2, months=2> 83.4±0.7μs
48.6±0.4μs
<SemiMonthEnd: day_of_month=15> 50.0±0.1μs
<SemiMonthBegin: day_of_month=15> 48.9±0.3μs
========================================= ============

[ 92.50%] ··· offset.OffestDatetimeArithmetic.time_subtract_10 ok
[ 92.50%] ··· ========================================= ============
offset
----------------------------------------- ------------
83.9±0.8μs
<BusinessYearEnd: month=12> 51.9±1μs
<BusinessYearBegin: month=1> 52.4±0.2μs
<BusinessQuarterEnd: startingMonth=3> 50.9±0.4μs
<BusinessQuarterBegin: startingMonth=3> 51.6±0.4μs
48.8±0.5μs
47.6±0.1μs
(0) 101±2μs
(1) 86.1±0.9μs
294±2μs
(0) 263±3μs
(1) 259±4μs
<YearEnd: month=12> 51.4±1μs
<YearBegin: month=1> 51.1±0.6μs
<QuarterEnd: startingMonth=3> 51.1±0.6μs
<QuarterBegin: startingMonth=3> 51.5±0.5μs
46.7±0.4μs
47.5±1μs
<DateOffset: days=2, months=2> 296±5μs
54.3±0.3μs
<SemiMonthEnd: day_of_month=15> 54.8±0.1μs
<SemiMonthBegin: day_of_month=15> 56.8±0.2μs
========================================= ============

[ 95.00%] ··· offset.OffsetDatetimeIndexArithmetic.time_add_offset ok
[ 95.00%] ··· ========================================= =============
offset
----------------------------------------- -------------
719±0.7μs
<BusinessYearEnd: month=12> 405±1μs
<BusinessYearBegin: month=1> 388±3μs
<BusinessQuarterEnd: startingMonth=3> 409±4μs
<BusinessQuarterBegin: startingMonth=3> 374±1μs
398±7μs
364±3μs
(0) 67.2±0.5ms
(1) 67.2±0.5ms
326±4ms
(0) 221±0.9ms
(1) 222±2ms
<YearEnd: month=12> 364±3μs
<YearBegin: month=1> 341±0.3μs
<QuarterEnd: startingMonth=3> 356±5μs
<QuarterBegin: startingMonth=3> 343±4μs
358±5μs
339±1μs
<DateOffset: days=2, months=2> 941±1μs
3.18±0.01ms
<SemiMonthEnd: day_of_month=15> 4.02±0.02ms
<SemiMonthBegin: day_of_month=15> 3.66±0.03ms
========================================= =============

[ 97.50%] ··· offset.OffsetSeriesArithmetic.time_add_offset ok
[ 97.50%] ··· ========================================= =============
offset
----------------------------------------- -------------
674±3μs
<BusinessYearEnd: month=12> 686±4μs
<BusinessYearBegin: month=1> 659±3μs
<BusinessQuarterEnd: startingMonth=3> 686±10μs
<BusinessQuarterBegin: startingMonth=3> 646±2μs
672±1μs
633±2μs
(0) 66.4±0.4ms
(1) 65.8±0.8ms
333±0.9ms
(0) 221±2ms
(1) 220±0.8ms
<YearEnd: month=12> 632±4μs
<YearBegin: month=1> 619±6μs
<QuarterEnd: startingMonth=3> 631±2μs
<QuarterBegin: startingMonth=3> 620±9μs
630±6μs
615±2μs
<DateOffset: days=2, months=2> 910±3μs
3.13±0.06ms
<SemiMonthEnd: day_of_month=15> 4.01±0.02ms
<SemiMonthBegin: day_of_month=15> 3.61±0.01ms
========================================= =============

[100.00%] ··· offset.OnOffset.time_on_offset ok
[100.00%] ··· ========================================= =============
offset
----------------------------------------- -------------
9.82±0.3μs
<BusinessYearEnd: month=12> 17.4±0.2μs
<BusinessYearBegin: month=1> 6.18±0.07μs
<BusinessQuarterEnd: startingMonth=3> 9.89±0.01μs
<BusinessQuarterBegin: startingMonth=3> 9.98±0.4μs
12.2±0.08μs
12.4±0.6μs
(0) 600±10μs
(1) 591±10μs
11.2±0.1ms
(0) 10.2±0.2ms
(1) 10.4±0.03ms
<YearEnd: month=12> 17.4±0.4μs
<YearBegin: month=1> 6.19±0.06μs
<QuarterEnd: startingMonth=3> 10.3±0.4μs
<QuarterBegin: startingMonth=3> 9.36±0.04μs
11.9±0.09μs
9.35±0.6μs
<DateOffset: days=2, months=2> 6.48±0.03μs
6.19±0.03μs
<SemiMonthEnd: day_of_month=15> 12.7±0.05μs
<SemiMonthBegin: day_of_month=15> 7.64±0.09μs
========================================= =============

BENCHMARKS NOT SIGNIFICANTLY CHANGED.
(pandas_dev) Richards-Mac-Pro:asv_bench stanton$

@WillAyd WillAyd merged commit b1eb97b into pandas-dev:master Oct 24, 2019
@WillAyd
Copy link
Member

WillAyd commented Oct 24, 2019

Thanks @rhstanton very nice PR

@rhstanton rhstanton deleted the holiday_update branch October 24, 2019 01:58
HawkinsBA pushed a commit to HawkinsBA/pandas that referenced this pull request Oct 29, 2019
Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in business-day logic in CustomBusinessDay?
7 participants