-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Fix Issues with FY5253 and nearest w/ year end in Dec #5405
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
Conversation
|
||
def apply(self, other): | ||
n = self.n | ||
daten1 = self.get_year_end(datetime(other.year-1, self.startingMonth,1)) | ||
date0 = self.get_year_end(datetime(other.year, self.startingMonth,1)) | ||
date1 = self.get_year_end(datetime(other.year+1, self.startingMonth,1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe clearer if prev_year
, cur_year
, next_year
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
On Fri, Nov 1, 2013 at 12:18 AM, Jeff Tratner [email protected]:
In pandas/tseries/offsets.py:
def apply(self, other): n = self.n
daten1 = self.get_year_end(datetime(other.year-1, self.startingMonth,1))
date0 = self.get_year_end(datetime(other.year, self.startingMonth,1))
date1 = self.get_year_end(datetime(other.year+1, self.startingMonth,1))
maybe clearer if prev_year, cur_year, next_year
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/5405/files#r7363235
.
@jtratner Other than that, any other changes? I would like to get this fix merged in for v13 |
Need to rebase. |
Of course |
it just was not mergeable. If you make that change for clarity and pinky-swear that it's doing what it's supposed to, I'm sure it's fine (you're sort of the expert on the retail year). 😄 I'll give it another once over after you change the naming there. |
I am becoming the expert. The problem was I was previously using the "year" of the dt as the canonical FY year. Unfortunately there are circumstances where two years end in the same calendar year. |
@jtratner Okay rebased, etc. |
I know we don't always ask this, but can you fix up your formatting? Just run a pep8 linter and then make changes to your portion of the code. Especially spaces around operators. |
@jtratner Should be PEP8 compliant. I also moved the new classes around as mentioned previously. |
@jtratner What do you think of the code? |
I hate to ask this (and it's okay if you can't), but is there any way you could split this into two commits? (one that does the code move through the file and one that makes the changes). It's hard to tell which changes are what. |
I'm sure a little copy and paste action will solve this; the move was relatively simple. Let me give it a shot . One day diff tools will handle situations like this. |
or maybe even save you from overzealous devs asking you to squash your commits 😝 |
@jtratner Commit split |
Fix Issues with FY5253 and nearest w/ year end in Dec
Thanks! |
There are currently some issues with FY5253 working with
variation="nearest"
andstartingMonth=12
.This PR fixes those issues and add some more tests.