8000 [Bug]: Erroneous deprecation warning help message · Issue #22577 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
[Bug]: Erroneous deprecation warning help message #22577
Closed
@laolux

Description

@laolux

Bug summary

When using the matplotlib.dates.epoch2num function I get a deprecation warning to use mdates.date2num instead. I cannot find out where mdates is supposed to be, but matplotlib.dates.date2num works pretty well.

Code for reproduction

import matplotlib
import matplotlib.dates
print(matplotlib.dates.epoch2num(123456789))
import datetime
print(matplotlib.dates.date2num(datetime.datetime.utcfromtimestamp(123456789)))

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 for matplotlib.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 the mdates 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0