-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Erroneous deprecation warning help message #22577
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
Comments
That is a correct guess! The typical thing in the matplotlib code base is to write
You are also correct that it should not be used in the deprecation messages. |
This is fixed in main, but maybe it should be back-ported to 3.5.2? At least for dates (but no harm for the other methods as well, right?) |
During more testing I noticed a different issue. |
Please do! (I'm trying to backport #22038 so that it ends up in 3.5.2 now and then I hope this issue can be closed.) (Looking at the history, epoch2num has been deprecated and then un-deprecated before...) |
This was closed by #22578 |
Bug summary
When using the
matplotlib.dates.epoch2num
function I get a deprecation warning to usemdates.date2num
instead. I cannot find out wheremdates
is supposed to be, butmatplotlib.dates.date2num
works pretty well.Code for reproduction
Actual outcome
Get a deprecation warning
The epoch2num function was deprecated in Matplotlib 3.5 and will be removed two minor releases later. Use mdates.date2num(datetime.utcfromtimestamp(e)) instead. print(matplotlib.dates.epoch2num(123456789))
Expected outcome
Get a more helpful deprecation warning with a function I can actually find and use instead of the deprecated one. For example
The epoch2num function was deprecated in Matplotlib 3.5 and will be removed two minor releases later. Use matplotlib.dates.date2num(datetime.datetime.utcfromtimestamp(123456789)) instead. print(matplotlib.dates.epoch2num(123456789))
Additional information
Maybe
mdates
is a common slang formatplotlib.dates
for the developers of matplotlib, but this is not clear for the users. I have been trying quite a bit to see where I could get themdates
thing from. This should be easy to fix and make the deprecation warning even more helpful.Operating system
Fedora
Matplotlib Version
3.5.1
Matplotlib Backend
No response
Python version
Python 3.10.2
Jupyter version
No response
Installation
Linux package manager
The text was updated successfully, but these errors were encountered: