Skip to content

BUG: frequencies.get_freq_code raises an error against offset with n != 1 #10350

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 1 commit into from
Jun 15, 2015

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Jun 13, 2015

Fixed a frequencies.get_freq_code raises ValueError against offset instance with n!=1. This is needed for #7832.

# OK
>>> import pandas.tseries.frequencies as f
>>> f.get_freq_code(('D', 3))
(6000, 3)
>>> import pandas.tseries.offsets as offsets
>>> f.get_freq_code(offsets.Day())
(6000, 1)

# NG!
>>> f.get_freq_code(offsets.Day(3))
ValueError: Unknown freqstr: 3D

Also, added docstrings and tests which make frequencies behavior understandable.

@sinhrks sinhrks added Bug Frequency DateOffsets labels Jun 13, 2015
@sinhrks sinhrks added this to the 0.17.0 milestone Jun 13, 2015
@jreback
Copy link
Contributor

jreback commented Jun 14, 2015

rebase against master
I just merged #10352 wasn't running doc tests before

merge on green

@sinhrks
Copy link
Member Author

sinhrks commented Jun 15, 2015

Thanks, rebased and now green. Merging.

sinhrks added a commit that referenced this pull request Jun 15, 2015
BUG: frequencies.get_freq_code raises an error against offset with n != 1
@sinhrks sinhrks merged commit 7636c2c into pandas-dev:master Jun 15, 2015
@sinhrks sinhrks deleted the freq_tests branch June 20, 2015 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants