Skip to content

Hack fix for BUG - GH24784 #28003

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

Closed
wants to merge 4 commits into from
Closed

Conversation

itssujeeth
Copy link

  • closes Locators off by one day #24784
  • tests added / passed - 1
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry - Test utility method "_check_plot_works_with_continuous_dates" and Test case "test_continuous_dates"

When using any of the Locators the date calculation (x-axis labels) are off by one day in case of continuous dates.
When using any of the Locators the date calculation (x-axis labels) are off by one day when continuous dates are provided.
When using any of the Locators the date calculation (x-axis labels) are off by one day when continuous dates are provided.
@pep8speaks
Copy link

pep8speaks commented Aug 18, 2019

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

Line 559:1: E302 expected 2 blank lines, found 1

Line 17:89: E501 line too long (113 > 88 characters)
Line 745:89: E501 line too long (109 > 88 characters)
Line 746:89: E501 line too long (110 > 88 characters)

Comment last updated at 2019-08-18 18:52:40 UTC

@@ -270,6 +270,13 @@ def _get_index_freq(data):
weekdays = np.unique(data.index.dayofweek)
if (5 in weekdays) or (6 in weekdays):
freq = None
# This is a hack introduced to avoid tick resolution adjustment issue -
Copy link
Member

Choose a reason for hiding this comment

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

This fix feels too specific. Guessing the fix might be in _use_dynamic_x where the locators are calculated

Copy link
Author

Choose a reason for hiding this comment

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

yes, the _use_dynamic_x is causing the locators to be off by one day if consecutive dates are provided.

@mroeschke mroeschke added Datetime Datetime data dtype Visualization plotting labels Aug 18, 2019
@jreback
Copy link
Contributor

jreback commented Sep 8, 2019

can you merge master and update to comments

@jreback
Copy link
Contributor

jreback commented Oct 3, 2019

closing this as stale, though its a nice change, needs a rebase and comments addressed.

@jreback jreback closed this Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Visualization plotting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Locators off by one day
4 participants