Skip to content

CLN: timeseries in plotting clean up #28020

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 8 commits into from
Sep 11, 2019

Conversation

charlesdong1991
Copy link
Member

@charlesdong1991 charlesdong1991 commented Aug 19, 2019

format_timedelta_ticks appears both in timeseries.py and matplotlib.converter.py, and there is no test. Then i look through the code base, it is only used in matplotlib.converter.py for TimeSeries_TimedeltaFormatter. So I remove the one in timeseries.py and add test for it.

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@charlesdong1991 charlesdong1991 changed the title CLN: remove identical format_timedelta_ticks function in plotting CLN: timeseries in plotting clean up Aug 19, 2019


class TestTimeDeltaConverter:
def setup_method(self, method):
Copy link
Contributor

Choose a reason for hiding this comment

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

We're trying to move away from the setup_-style of tests. Can you use the full name in the test?

)
def test_format_timedelta_ticks(self, x, decimal, format_expected):
tdc = converter.TimeSeries_TimedeltaFormatter
result = tdc.format_timedelta_ticks(x, pos=None, n_decimals=decimal)
Copy link
Member

Choose a reason for hiding this comment

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

would it be worthwhile to parametrize over pos values here? or would that obscure the logic we actually care about testing?

Copy link
Member Author

@charlesdong1991 charlesdong1991 Aug 20, 2019

Choose a reason for hiding this comment

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

pos is not being used in format_timdelta_ticks function, honestly i am not sure why/how this is used. So i just keep as is for now. @jbrockmendel

Copy link
Member

Choose a reason for hiding this comment

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

Leaving it as is sounds fine, thanks for looking into it.

@charlesdong1991
Copy link
Member Author

do you prefer to remove pos? @jbrockmendel or parametrize it?

@charlesdong1991
Copy link
Member Author

fancy a merge? :D @TomAugspurger

@WillAyd
Copy link
Member

WillAyd commented Aug 26, 2019

Seems OK to me though not super familiar with this part of the code base. Looking at the comment preceding your change, is _format_coord something we can get rid of as well (OK as separate PR - just curious)

@WillAyd WillAyd added this to the 1.0 milestone Aug 26, 2019
@jreback
Copy link
Contributor

jreback commented Sep 8, 2019

lgtm. can you merge master and ping on green.

@charlesdong1991
Copy link
Member Author

charlesdong1991 commented Sep 9, 2019

ping @jreback

@WillAyd WillAyd merged commit e5fec87 into pandas-dev:master Sep 11, 2019
@WillAyd
Copy link
Member

WillAyd commented Sep 11, 2019

Thanks @charlesdong1991

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants