Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FIX: undeprecate and update num2epoch/epoch2num#17983

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedJul 20, 2020
edited
Loading

PR Summary

#15008 added a new variable epoch.

At the time I did not update the unfortunately namedepoch2num andnum2epoch because Matplotlib does not use these. They are also ill-named because in this caseepoch refers to a UNIX-like time of seconds since 1970-01-01, and thats not at all what an epoch is. We also deprecated these functions at the time.

Unfortunately pandas uses them, and they need to be made compatible with the new epoch handling.pandas-dev/pandas#35350 andpandas-dev/pandas#34850

Here I've updated those functions to work with the variable epoch, and removed the deprecation, and added a test for the basic functionality with both the old and new epoch.

On the pandas side,

importdatetimeimportmatplotlibimportmatplotlib.pyplotaspltfrommatplotlib.datesimportDateFormatterfrompandas.plottingimportregister_matplotlib_convertersregister_matplotlib_converters()t= [datetime.datetime(2022,12,31,0,0),datetime.datetime(2022,11,30,0,0),datetime.datetime(2022,10,31,0,0),]s= [0.0,0.1,0.2]fig,ax=plt.subplots()ax.plot_date(x=t,y=s)ax.xaxis.set_major_formatter(DateFormatter("%b '%y"))plt.xticks(rotation=90)plt.show()

is fixed, with no further work on their side needed.

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

theavey reacted with thumbs up emoji
@jklymakjklymak added Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: date handling labelsJul 20, 2020
@jklymakjklymak added this to thev3.3.1 milestoneJul 20, 2020
@jklymak
Copy link
MemberAuthor

Marking as release critical - this will break anyone using pandas date converter and Matplotlib 3.0.

@tacaswell
Copy link
Member

Do we need to pull back notes in API changes too?

@jklymak
Copy link
MemberAuthor

Probably, unless we wanted to soft un-deprecate it 😉 I don't think we should be maintaining a second floating-point date representation. Looking at pandas, I think they don't need the call any more either since we have supported datetime64 for quite while....

Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

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

Blocking on updating API change note.

jklymak reacted with thumbs up emoji
@jklymakjklymakforce-pushed thefix-pandas-need-num2epoch branch from1487765 to52528feCompareJuly 20, 2020 23:08
@jklymakjklymakforce-pushed thefix-pandas-need-num2epoch branch from52528fe to32ef145CompareJuly 20, 2020 23:08
@QuLogicQuLogic merged commit57c8baa intomatplotlib:masterJul 21, 2020
@lumberbot-app
Copy link

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.3.x$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 57c8baaf85f0cfd44a27ef834dc971128b7f8ee4
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #17983: FIX: undeprecate and update num2epoch/epoch2num'
  1. Push to a named branch :
git push YOURFORK v3.3.x:auto-backport-of-pr-17983-on-v3.3.x
  1. Create a PR against branch v3.3.x, I would have named this PR:

"Backport PR#17983 on branch v3.3.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free tosuggest an improvement.

@jklymak
Copy link
MemberAuthor

OK, this is upset because 3.3.x is not tracking doc/api/next_api_changes/deprecations/. Where should the un-deprecation notice go? And if it goes in 3.3.x, should the notice be removed from master?

@tacaswell
Copy link
Member

In the past we have added sections to the top of the minor version API changes page for the patch-release back-tracking on the deprecation (or had to retro-actively document accidentally API changes).

jklymak reacted with thumbs up emoji

jklymak pushed a commit to jklymak/matplotlib that referenced this pull requestJul 21, 2020
…epochFIX: undeprecate and update num2epoch/epoch2num
jklymak added a commit to jklymak/matplotlib that referenced this pull requestJul 21, 2020
jklymak added a commit to jklymak/matplotlib that referenced this pull requestJul 21, 2020
@jklymakjklymak mentioned this pull requestJul 21, 2020
6 tasks
@jklymakjklymak deleted the fix-pandas-need-num2epoch branchJuly 21, 2020 05:02
@QuLogicQuLogic mentioned this pull requestAug 14, 2020
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@QuLogicQuLogicQuLogic approved these changes

Assignees
No one assigned
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.topic: date handling
Projects
None yet
Milestone
v3.3.1
Development

Successfully merging this pull request may close these issues.

3 participants
@jklymak@tacaswell@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp